Jump to content

JQuery & IE


codefossa

Recommended Posts

Well, I wrote a simple posting code to send a message to another page without refreshing.  While this works perfectly fine in Firefox, it don't work at all in IE.  It acts as if the whole script ain't there.

 

Here's what I got:

		$(function()
	{
		$(".button").click(function()
		{
			var message = $("#message").val();
			var dataString = "message=" + message;

			if (message == "")
			{
				alert("You must type a message before submitting.");
				$("#message").focus();
			}
			else
			{
				$.ajax
				({
					type: "POST",
					url: "/chat/post.php",
					data: dataString,
					success: function()
					{
						$("#message").val("");
						$("#message").focus();
						load("/chat/load.php", "chatbox");
					}
				})
			}

			return false;
		});
	});

 

And here's the HTML to go along with it.

	<h1>Public Chat</h1>
<center>
	<div class="chatbox_message">
		<form method="post" action="">
			<input type="text" id="message" name="message" style="width: 92%;" autocomplete="off">
			<input type="submit" id="button" name="send" value="Send" style="width: 6%;" class="button">
		</form>
	</div>
</center>

<div class="chatbox" id="chatbox"></div>

Link to comment
Share on other sites

I have a similar problem, I have some JQuery code - I wrote - that works great in Chrome and Firefox but doesnt work at all in IE. It says that there is an error on line 1 in the JQuery code, which is the code taken straight out of www.jquery.com .

Any ideas to why this occurs?

Link to comment
Share on other sites

Uhm this topic is marked solved, but i don't see a solution, please post it

I'm unsure of what the issue may have been.  One day it was failing, the next it was working.  I don't have constant access to Windows IE, so I can only test once-in-a-while.  I guess nothing was wrong with my script, just had a PC issue that was resolved when they restarted the comp or whatever it may have been.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.