Dear all I have developed code with ajax and JQuery , I have Got Response from my.php, I have Tried to extract the Values of response ,Here the code
My.php
?php
echo '<div id="title">My Title </div>';
echo '<div id="message"> My message </div>';
?>
I Try to extract Title and Message SO My Code is Below
<script type="text/javascript" src="js/jquery-1.2.6.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert("OK");
$.ajax({
type:"POST",
url: "my.php",
cache:false ,
success: function(data){
$("#response").html(data);
var $response=$(data);
var oneval = $response.find('#title').text();
var subval = $response.find('#message').text();
alert(oneval);
}
});
});
</script>
</head>
<body>
<div id="response">
</div>
</body>
</html>
...
Problem is when I Tried To alert ,It Not working What Wrong with This Logic,Should i use anyother function To Extract Title and Message