Below is the simple code to call the ajax but when I click submit button,it doesn't work. I did echo "hello world"; in second file "test.php". Can someone get me out of this?
<html>
<head>
<title>AJAX TUTORIAL</title>
<script src= "jqueryy.js"></script>
<script>
$(document).ready(function(){
$("#sub").click(function(){
//var user_email=$("#email").val();
$.post("test.php",function(data){
$("#result").html(data);
});
});
});
</script>
</head>
<body>
<div id="box">
<input type="text" name="email" id="email"/>
<input type="submit" name="sub" id="sub" value="Submit"/>
<div id="result">
</div>
</div>
</body>
</html>