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 08-29-2012, 01:54 PM   PM User | #1
mbarandao
Regular Coder

 
Join Date: Nov 2010
Location: Washington DC
Posts: 311
Thanks: 19
Thanked 1 Time in 1 Post
mbarandao is an unknown quantity at this point
Uncaught ReferenceError: $ is not defined Only in Chrome

Hello:

Any ideas as to why I cannot get the script to work in chrome? it works fine in safari.
PHP Code:
$(window).load(function(){
$("#rcver").keyup(function() {
    var values = "";
    var colon = ":";
    var sendname = "<?php echo $fname;?>";
    var link = "\n\nGo to www.site.net and Click on Business Leads! (right of screen)";
    var msg2 =" my message is here";
    var msg = (" \n\nThis is ") +sendname +(".") + msg2 +sendname;// +link;//we concacte name and links to message body
   // var msg = " \n\nI Would like to share with you information about an exciting income opportunity. \n\nSincerely, \n"+sendname +link;
    $('#rcver') .each(function() {
        values += ("Hi ")+this.value +colon +msg;
    });
    $("#detailedmsg").val(values);
});

});
for the jquery file, I'm using:

PHP Code:
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script> 
I also have tried:
PHP Code:
$(document).load(function(){ 
with no luck...

In chrome, I'm getting:
PHP Code:
Uncaught ReferenceError: $ is not defined 

Thanks for the any input!
mbarandao is offline   Reply With Quote
Old 08-29-2012, 02:07 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Do you have an online example? With only the code I cannot see the problem here ...
devnull69 is offline   Reply With Quote
Old 08-29-2012, 02:15 PM   PM User | #3
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
try $(document).ready(function(){

also "Uncaught ReferenceError: $ is not defined " usually means the jquery file didnt load, or perhaps you have the library linked after the script so it hasnt loaded in the document yet.
__________________
- 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

Last edited by DanInMa; 08-29-2012 at 02:17 PM..
DanInMa is offline   Reply With Quote
Old 08-29-2012, 02:23 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,601
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
Quote:
Originally Posted by DanInMa View Post
try $(document).ready(function(){
You can even shorten that to $(function() {…});
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 08-29-2012, 04:44 PM   PM User | #5
mbarandao
Regular Coder

 
Join Date: Nov 2010
Location: Washington DC
Posts: 311
Thanks: 19
Thanked 1 Time in 1 Post
mbarandao is an unknown quantity at this point
Thanks for the replies!

DanInMa and VIPStephan your suggestion seems to produce the same error; while VIPStephan's works in safari, but DanInMa's does not work on either browser.

Any other suggestions!
mbarandao is offline   Reply With Quote
Old 08-29-2012, 05:29 PM   PM User | #6
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,601
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
You still haven’t shown us your code. Unfortunately we aren’t psychic.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 08-29-2012, 06:38 PM   PM User | #7
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
yeah if that didnt work we need to see more, definitely. are you using more than one library perhaps?
__________________
- 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

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 01:16 PM.


Advertisement
Log in to turn off these ads.