i) 具备一种分类功能,即需要以下列方式开展工作:
1. call a php file
2. log the values return by php file
3. have time delay
again repeat the above process for number of time
为此而撰写的书目和网址文件
<script type="text/javascript">
$(document).ready(function() {
listsValues="1,10,20";
n=0;
msgids = listsValues.split( , );
$.each(msgids, function() {
html="TEST MESSAGE";
n++;
setTimeout(function() {
$.ajax({
type: "POST",
url: "test1.php",
cache:false,
data:"id="+ msgids[n],
dataType: json ,
success: function(json)
{
var foo = json.foo;
uemail = foo.split( , );
console.log(uemail)
}
});
}, 1000);
});
});
</script>
页: 1
<?php
$id=$_POST[ id ];
$val="";
for($i=1;$i<=$id;$i++) {
$val.=$i;
}
$return["foo"] =$val;
print stripslashes(json_encode($return));
?>
but this is not working as a way i want, when i execute this script
i can see in firebug test1.php
file executes (called) for 3times and after that values are written in console
as i said waht i want was
1. execute test1.php file
2. write value in console
3. give delay
then repeat
增 编