Solved

IE8 Ad Loader

Posted on 2013-11-18
11
372 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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
 
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 43

Expert Comment

by:Rob
ID: 39813526
I'll have a look and do some testing and see what I can find...
0
 
LVL 43

Expert Comment

by:Rob
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

839 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