SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: jquery program

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jul 2011
    Location
    Hyderabad,India.
    Posts
    327
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery program

    i am new to jquery. i am running one simple jquery program.
    below is the code...
    Code:
    <html>
    <head>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
      $("button").click(function(){
        $("p").hide();
      });
    });
    </script>
    </head>
    
    <body>
    <h2>This is a heading</h2>
    <p>This is a paragraph.</p>
    <p>This is another paragraph.</p>
    <button>Click me</button>
    </body>
    </html>
    i am not getting what src="jquery.js" will contain

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Do you have the jQuery framework in the same location of your HTML file? If you don't a simple solution is to use jQuery's or Google's CDN servers.

    http://code.jquery.com/jquery-latest.min.js

  3. #3
    SitePoint Addict
    Join Date
    Jul 2011
    Location
    Hyderabad,India.
    Posts
    327
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    means i need to keep them in one folder both the below html program and
    jquery-latest.min.js right ...
    where is the location to be kept.....

  4. #4
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Your script tag needs to look like the following...

    HTML Code:
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>


Bookmarks

Posting Permissions

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