I am having trouble with this code:

<!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>

The problem is, the .load() function won't work. I have tried everything, nothing worked. The scripts, fixes, everything.

Recommended Answers

All 2 Replies

The first issue I see is that your braces and parethesis are not matching up correctly in the jQuery block.

commented: Thank you for helping me. It's fixed. :D +2

How do you fix it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.