$.ajax({
type:"POST",
async:false,
contentType:"application/x-www-form-urlencoded",
url:"http://localhost/Test/Service/ServiceForJquery.asmx/HelloWorld",
data:"{str:'hahaha'}",
dataType:'json',
success:successFunction,
error:errorFunction
});
type:"POST",
async:false,
contentType:"application/x-www-form-urlencoded",
url:"http://localhost/Test/Service/ServiceForJquery.asmx/HelloWorld",
data:"{str:'hahaha'}",
dataType:'json',
success:successFunction,
error:errorFunction
});
});
改为:
$("#Button1").click(function(){
typeValue=$("#Text1").val();
$.ajax({
type:"POST",
async:false,
contentType:"application/x-www-form-urlencoded",
url:"http://localhost/Test/Service/ServiceForJquery.asmx/HelloWorld",
data:{str:'hahaha'},
dataType:'json',
success:successFunction,
error:errorFunction
});
});