Reputation: 1
i need use jquery load function in same page. for example:
echo"
<table style='border:1px solid #666;'>
<tr>";
do {
printf("
<td><a data-val='%s' id='ip'>%s</a><br><hr></td>
",$showrequestarr['ip'],$showrequestarr['ip']);
}
while ($showrequestarr = mysql_fetch_array ($showrequest));
/****************************chat*****************************/
if (isset($_REQUEST['userip'])) {
$showresult = mysql_query("SELECT text FROM message WHERE userip = '$userip'");
$showarray = mysql_fetch_array ($showresult);
}
this is my php page and i want after clicking load function send REQUEST using load function in same page
$("a").click(function() {
var ip = $(this).data('val');
$("#change").load('operator.php' {"userip":ip} );
});
this is jquery code i dont know how use in this moment load function .... please help :)
Upvotes: 0
Views: 675
Reputation: 218702
You are missing a comma between the url and the parameters.
$(function(){
$("a").click(function() {
var ip = $(this).data('val');
$("#change").load('operator.php', {"userip":ip} );
});
});
Upvotes: 2