Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conflict between Google Ads and Jquery

    I recently built a site that used Jquery and everything worked fine until I added the Java script from Google adwords. Now the content box from the Jquery plug in displays a loading sign instead of any actual content. I know almost no Javascript so I have no idea why its not working.

    Code:
    <script type="text/javascript">
    $(window).load(function() {
    		$('#slider').nivoSlider();
    	});
    </script>
    <div class="ad">
    
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-3152359102333772";
    /* The Jailbreak Guide Ad 1 */
    google_ad_slot = "1178371691";
    google_ad_width = 160;
    google_ad_height = 600;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </div>
    Last edited by VIPStephan; 03-11-2012 at 09:41 PM. Reason: fixed code BB tags

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,702
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    If this is about JavaScript, why are you posting it in the HTML/CSS section then? Anyway, look at the JavaScript console thats built into the browser (unless you use IE which you shouldn’t anyway), it might show the error. If you have no idea about anything then post a link and someone might have a look at it.

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked the Javascript console and didn't find any errors. I did try changing the order of the javascript code (I put the google script first) and afterwords the Jquery content was displayed but the google ad was not.

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    well this:
    Code:
    $(window).load(function() {
    		$('#slider').nivoSlider();
    	});
    should be this:

    Code:
    $(function() {
    		$('#slider').nivoSlider();
    	});
    in regards to the adwords. be sure your popup blocker or other security software isnt blocking it. I have most ad services blocked so I have to undo that when I work with such things.

  • #5
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DanInMa View Post
    well this:
    Code:
    $(window).load(function() {
    		$('#slider').nivoSlider();
    	});
    should be this:

    Code:
    $(function() {
    		$('#slider').nivoSlider();
    	});
    in regards to the adwords. be sure your popup blocker or other security software isnt blocking it. I have most ad services blocked so I have to undo that when I work with such things.
    Wow it worked, thanks, I've been searching the internet for a couple days and I hadn't found anything so thanks a lot for the help

  • #6
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    np looks like you maybe got window.onload=function(){

    }

    mixed up with jQuery's dom ready function. We learn everyday


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •