Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-11-2012, 08:20 PM   PM User | #1
jvdlcr125
New to the CF scene

 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jvdlcr125 is an unknown quantity at this point
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
jvdlcr125 is offline   Reply With Quote
Old 03-11-2012, 09:43 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,615
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 03-12-2012, 04:11 AM   PM User | #3
jvdlcr125
New to the CF scene

 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jvdlcr125 is an unknown quantity at this point
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.
jvdlcr125 is offline   Reply With Quote
Old 03-12-2012, 04:22 AM   PM User | #4
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
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.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 03-12-2012, 04:32 AM   PM User | #5
jvdlcr125
New to the CF scene

 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jvdlcr125 is an unknown quantity at this point
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
jvdlcr125 is offline   Reply With Quote
Old 03-12-2012, 04:43 AM   PM User | #6
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
np looks like you maybe got window.onload=function(){

}

mixed up with jQuery's dom ready function. We learn everyday
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Tags
adwords, conflict, google, javascript, jquery

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:13 PM.


Advertisement
Log in to turn off these ads.