-3
我试图创造一个参数q
将被动态定义一个Ajax函数调用,而$.get
函数将返回取决于由阿贾克斯返回的数据true
或false
呼叫。
<a href="any.php" class="idd" id="1">add score</a>
<a href="any.php" class="idd" id="2">add score</a>
<a href="any.php" class="idd" id="3">add score</a>
$(".idd").click(function(event) {
window.Eid=event.target.id;
//alert(window.Eid);
});
$.get("getDetails.php",
{ q: window.Eid }, // I want this variable dynamic
function(m) {
$(".idd").click(function() {
//var Eid=event.target.id;
alert(m);
if(m>0) {
return false;
} else {
return true;
}
});
});
谢谢鲍勃你是最好的编码器。 –