Solved

IE8 Ad Loader

Posted on 2013-11-18
11
370 Views
Last Modified: 2014-02-08
I load my AdSense ads at the top of my web page at http://www.RomanceStuck.com. I then use Javascript to move those ads to various areas on the web page. This seems to work for most browsers but I just realized it is not working in IE8. IE8 loads the ads at the top of the page but it never moves the ads. Can someone tell me what I am doing wrong?

Thanks!
0
Comment
Question by:webstuck5
11 Comments
 
LVL 7

Expert Comment

by:valmatic
ID: 39659552
ie8 is not a supported browser for adsense effective 10-1-13 see below post.
https://support.google.com/adsense/answer/191268?hl=en
0
 

Author Comment

by:webstuck5
ID: 39660344
It states that, "Note that this change will only affect your ability to access the AdSense interface. Please be assured that users using Internet Explorer 8 to view ads on your site will not be affected." The AdSense ads load on my page but my javascript isn't moving them to where I need them to go. Thanks!
0
 

Author Comment

by:webstuck5
ID: 39703545
Any ideas?
0
 

Author Comment

by:webstuck5
ID: 39774387
An example of the code that I use to move the ad is:

      <!-- POSITION AD - START -->
        <div id="ad_nav_1_position">
        </div>
        <script>
          if (document.getElementById('ad_nav_1') != null)
          {
            document.getElementById('ad_nav_1_position').appendChild(document.getElementById('ad_nav_1'));
          }
        </script>
      <!-- POSITION AD - END -->
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39813495
Can you help paint a picture of what you mean by move the ad(s)?  Do you mean when the browser is resized?

Are you talking about
<script>
        document.write('<div id="' + ad1_position + '" style="' + ad1_div_style + ' width=' + ad1_width + 'px; height=' + ad1_height + 'px;">');
        document.write('<scr' + 'ipt async ' + 'src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">' + '</scr' + 'ipt>');
        document.write('<ins class="adsbygoogle" ');
        document.write('style="display:inline-block;width:' + ad1_width + 'px;height:' + ad1_height + 'px" ');
        document.write('data-ad-client="' + ad_client + '" ');
        document.write('data-ad-slot="' + ad1_slot + '">');
        document.write('</ins>');
        document.write('<scr' + 'ipt>' + '(adsbygoogle = window.adsbygoogle || []).push({});' + '</scr' + 'ipt>');
        document.write('</div>');
        document.write('<div id="' + ad2_position + '" style="' + ad2_div_style + ' width=' + ad2_width + 'px; height=' + ad2_height + 'px;">');
        document.write('<scr' + 'ipt async ' + 'src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">' + '</scr' + 'ipt>');
        document.write('<ins class="adsbygoogle" ');
        document.write('style="display:inline-block;width:' + ad2_width + 'px;height:' + ad2_height + 'px" ');
        document.write('data-ad-client="' + ad_client + '" ');
        document.write('data-ad-slot="' + ad2_slot + '">');
        document.write('</ins>');
        document.write('<scr' + 'ipt>' + '(adsbygoogle = window.adsbygoogle || []).push({});' + '</scr' + 'ipt>');
        document.write('</div>');
        document.write('<div id="' + ad3_position + '" style="' + ad3_div_style + ' width=' + ad3_width + 'px; height=' + ad3_height + 'px;">');
        document.write('<scr' + 'ipt async ' + 'src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">' + '</scr' + 'ipt>');
        document.write('<ins class="adsbygoogle" ');
        document.write('style="display:inline-block;width:' + ad3_width + 'px;height:' + ad3_height + 'px" ');
        document.write('data-ad-client="' + ad_client + '" ');
        document.write('data-ad-slot="' + ad3_slot + '">');
        document.write('</ins>');
        document.write('<scr' + 'ipt>' + '(adsbygoogle = window.adsbygoogle || []).push({});' + '</scr' + 'ipt>');
        document.write('</div>');
    </script>

Open in new window

0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39813526
I'll have a look and do some testing and see what I can find...
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39814093
The code isn't working because the adwords aren't being loaded into your <div id="ad_nav_1_position"> element

empty element
You could try targeting the iframe to move the ads but looks that the id of the iframe is variable.

I suspect it will be the order in which the javascript loads.  There is so much code on this page thought it's making it virtually impossible to know what's going on.
0
 

Accepted Solution

by:
webstuck5 earned 0 total points
ID: 39817109
All of a sudden, it looks like the ads are displaying where I want them but I didn't change anything Maybe they had been cached or something. Thanks for all your help!
0
 

Author Closing Comment

by:webstuck5
ID: 39843933
Apparently, my code was right but the page wasn't updating.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now