0

I have an OWL carousel (v2) that when you click the next button it reloads a div that contains an Ad (div is called .slideAd) -- i have looked at other pages on SO and none seem to work -- i feel like i have it, what am i missing?

I have this code, but it always throws a 500 server error, any help would be greatly appreciated

$(".rSlidesNav .n").click(function(e) {
    var pathtopage = window.location.href;
            $('.slideAd').load(pathtopage + ' #slideAd');   
});
Ignazio
  • 10,504
  • 1
  • 14
  • 25
DEM
  • 333
  • 2
  • 4
  • 16

1 Answers1

0

Try using $.get() , .outerHTML

  // `""` as `url` should request current document
  $.get("", function(html) {
    $(".slideAd").html($(html).find("#slideAd")[0].outerHTML)
  })
guest271314
  • 1
  • 15
  • 104
  • 177
  • Hi, still getting that internal server error with this code. any other thoughts, or can it just not be done? – DEM Feb 13 '16 at 18:46
  • Is `php` serving `html` ? `500` is server side error code – guest271314 Feb 13 '16 at 18:49
  • yeah im getting this error in console - send m.extend.ajax m.(anonymous function) m.event.dispatch r.handle – DEM Feb 13 '16 at 19:03