21,886
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
function test(){
$.ajax({
url:"laji.php",
success:function(d){
return d;
}
});
}
function hello(){
var x=test();
alert(x);
}
</script>
<button onclick="hello();">hello</button>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
function test(){
$.ajax({
url:"laji.php",
success:function(d){
alert(d);
return d;
//或者这里调用你后面的处理。
}
});
}
function hello(){
var x=test();
}
</script>
<button onclick="hello();">hello</button>