<script type="text/javascript">
$(function () {
$.ajaxSetup({
url:"https://www.imooc.com/data/check.php",
type:"post",
success:function(data){
$("ul").append("<li>你输入的<b> "
+ $("#txtNumber").val() + " </b>是<b> "
+ data + " </b></li>");
})
});
$("#btnShow_1").bind("click", function () {
$.ajax({
data: { num: $("#txtNumber").val() },
url: "https://www.imooc.com/data/check.php"
});
})
$("#btnShow_2").bind("click", function () {
$.ajax({
data: { num: $("#txtNumber").val() },
url: "https://www.imooc.com/data/check_f.php"
});
})
});
</script>
$.ajaxSetup({
type:'POST',
success:function(data){
$("ul").append("<li>你输入的<b> "
+ $("#txtNumber").val() + " </b>是<b> "
+ data + " </b></li>");
}
})
不需要url
谢谢!