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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post

    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!

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    Do you have an online example? With only the code I cannot see the problem here ...

  • #3
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    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.
    Last edited by DanInMa; 08-29-2012 at 02:17 PM.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Quote Originally Posted by DanInMa View Post
    try $(document).ready(function(){
    You can even shorten that to $(function() {…});

  • #5
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    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!

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    You still haven’t shown us your code. Unfortunately we aren’t psychic.

  • #7
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    yeah if that didnt work we need to see more, definitely. are you using more than one library perhaps?


  •  

    Posting Permissions

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