Solved

IE8 Ad Loader

Posted on 2013-11-18
11
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

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 53

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This article discusses how to implement server side field validation and display customized error messages to the client.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

717 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