Public Ticket #1296362
AJAX Infinite Loader and AJAX Ads


  • Lance Baily started the conversation

    The theme works great, but I am having a few miscellaneous issues I was hoping to get some help with.

    First, the infinite loader on the homepage seems to conflict with AJAX ads from AdButler, if they are added via the 'ad' sections that appear inside the feed. The conflict appears to be something with document.write() hitting the ads. The site will load fine, but when you go to click 'Load More', if an AJAX AdButler ad is present, the page goes white and hangs.

    FYI, if you go to check the website, no AJAX ads are currently present on the homepage of the site inside the feed itself (although there are some present in the header and sidebar), as I had to swap them in for image ads (no JS). I'd like to be able to use the AJAX ads, if possible.

    The Adbutler ajax ads look like:

    <!-- Website Inline Blog #1 Top 720x300 [async] -->
    if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'http://ab169263.adbutler-luxon.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}<script type="text/javascript">if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'http://ab169263.adbutler-luxon.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}</script>
    <script type="text/javascript">
    var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
    var abkw = window.abkw || '';
    var plc267887 = window.plc267887 || 0;
    document.write('<'+'div id="placement_267887_'+plc267887+'"></'+'div>');
    AdButler.ads.push({handler: function(opt){ AdButler.register(169263, 267887, [720,300], 'placement_267887_'+opt.place, opt); }, opt: { place: plc267887++, keywords: abkw, domain: 'ab169263.adbutler-luxon.com', click:'CLICK_MACRO_PLACEHOLDER' }});

    Please, assist!

  •  293
    Brian replied

    When the site goes white I'd like to see the console because it will likely have an error message with more information on what happened. I can't check it currently since you don't have ajax ads enabled, but if you could add one and then refresh and take a snapshot or copy+paste the console I'd appreciate it.

  • Lance Baily replied

    The thing is, I'm not sure it matters... This is the expected behavior for document.write() after the page has finished loading (it implicitly runs document.open() which would then blank the page; and that is expected behavior). Originally, I thought the theme's 'load AJAX Ads' would have some sort've craploader-type document.write() hijacker to help, but then I realized that's a poor assumption.

    Anyway, yes, I attached a FireFox console screenshot (browser-console.png). The FireFox unbalanced tree note is a mention for an ad outside of the main post-area in a sidebar (and despite the fact that there are 4 nearly identical ads; FireFox only shows that particular error once). 

    The FireBug console (firebug-console.png) shows admin-ajax.php load (the 'Load More' click) and then blanks. Again, I think this is expected behavior given the adbutler ads use document.write(). But, I am open to whatever ideas you may have!

    Thank you for your help, Brian.

    Attached files:  browser-console.png

  •  293
    Brian replied

    I've been looking into this and I'm afraid I'm at a loss, unfortunately. I'll let you know if anything comes to mind in the future, but in the mean time I'd recommend maybe having someone else look at it from a service like Envato Studio or similar. Sorry about that.