Ajax + php without any new problems .... Find Daniel & lt; div & nbsp; class = 'petz _ Box' & gt; & nbsp; & lt; div & nbsp; class = "petz_img & nbsp; fillet" & gt; ajax + php refreshing problems .... Qiniu
"Alt =" ">
<{$ Volist. pictit}>
"> Like
<{$ Volist. num}>
<{/Foreach}>
$ (Function (){
$ (". Xh"). bind ('click', function (){
Var id = $ (this). attr ('vv ');
$. Ajax ({
Type: 'post ',
Url: '_ URL _/addnum ',
Data: 'Id = '+ id,
// DataType: "json ",
Success: function (res ){
Var I = res; // The value returned by the server
$ (This). next (). text (I); // why can't I change the value of the html page without refreshing the status ???
}
});
});
});
Script
In addition, each member can only click once and cannot click next time. Share:
------ Solution --------------------
$ (This). next (). text (I );
Who do you think this $ (this) is?
Isn't it $. ajax?
------ Solution --------------------
In addition, each member can only click once and cannot click next time.
Directly Create an onclick event and click it to remove the innerHTML link.