I am getting result 3 div's but i want to get result for checking.
my ajax page
<div> <!-- This is empty div and please don't remove this -->
<div id="inner_1">
<?php echo $val; ?>
</div>
<div id="inner_2">
<?php echo $val; ?>
</div>
</div>
my html page
<div id="div_1"></div>
<a href="" class="button">Click Me</a>
<div id="div_2"></div>
my javascript page is
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js" language="javascript"></script>
<script type="text/javascript" language="javascript">
$( function() {
$( '.button' ).click(function() {
var postData = ''"; // you can send any data to ajax file.
$('#div_1 , #div_2').html('<img src="ajax-loader.gif" />'); // placeholder
$.ajax( {
url : 'ajax_file.php', // your ajax file
type : 'post',
data : postData,
success : function( resp ) {
$('#div_1').html($('#inner_1' , resp).html());
var result=('#div_2').html($('#inner_2' , resp).html());
alert(result);
// here i want to get result
// but i am getting object
// for the purpose of validation negative or positive in my project
}
});
return false;
});
});
</script>