0

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.

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Djmann1013
1

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

Edited by JorgeM

Votes + Comments
Thank you for helping me. It's fixed. :D
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.