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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Can't get jquery to work

    hi all,

    I wanted to start and learn jquery but i can't even get it to work :s.
    I followed a tutorial and did the exact same thing but it doesn't work for me.
    It is probably something stupid but I don't see it.

    Code:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Index</title>
    <link href="styletest.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="jquery-1.8.0.min.js"</script>
    <script type="text/javascript">
    $(document).ready(function(){
    
    alert("yay");
    });
    </script>
    </head>

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    Did you download the latest "jquery-1.8.0.min.js" and put it into the same folder as your HTML page?

    You forgot the closing > bracket for the first <script> tag (right before </script>)

    If you don't want to download a copy of jquery you can as well use one of the many CDN providers for it, for example
    Code:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>

  • Users who have thanked devnull69 for this post:

    stepy (08-22-2012)

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It was the bracket.. ty


  •  

    Posting Permissions

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