problem with jquery ajax and php
I recently started learning jquery and I'm frustrated with a problem i got.
I use the following code in the html page:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#texty").keyup(function(){
$.post("http://localhost/test/test.php",function(data){ $('.try').html(data);});
});
});
</script>
</head>
<body>
<form id="text">
<input type="text" id="texty" style="width:100px;"/>
<div class='try'></div>
</form>
</body>
and in the php page:
<?php
echo "test";
?>
The simplest test.
It works in IE 8, but in Firefox it returns an empty response.
I already tried to google the problem a hundred times and didn't see any thing helping.
So, if anyone can help me, cos I really want to start using jquery.
thanks.