SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Non-Member
    Join Date
    Jun 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Load function is not working

    Hello Friends,

    I stuck with fuction in html. .load function is not working. i have tired but scripts, fixes nothing is working.

    <!DOCTYPE html>
    <head>
    <title>AJAX Chat Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- Script -->
    <script src="jquery.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready( function(){
    $("#chats").load("feed.php");
    $("#post").submit( function(){
    return false;
    }
    }
    )
    );
    </script>
    </head>
    <body>
    <!-- Messages display here -->
    <div id="chats"></div>
    <!-- Post the messages -->
    <form id="post">
    <input type="hidden" value="<?php echo $_SESSION['username']; ?>" />
    <label>Message</label>&nbsp; &nbsp;
    <input type="" maxlength="140" name="messages" />
    <br />
    <label></label>
    <input type="submit" value="Chat" />
    </form>
    </body>
    </html>
    looking for help kindly help me out
    thanks in advanced

  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)
    Try the following, you had a couple of errors in your code which were related to unclosed or too many closing brackets in the wrong place.

    Code JavaScript:
    $(document).ready(function() {
        $("#chats").load("feed.php");
     
        $("#post").submit(function() {
            return false;
        });
    });


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
  •