data:{num:$("#txtNumber").val()} ,data为请求时传递的数据,后面的大括号里是一个对象,就是一个键值对,可以理解为名字叫做num,值就是$("#txtNumber").val(),就是你输入的值,这个不懂你前面的要重看了
2017-04-03
$.ajaxSetup({
type:"POST",
success:function(data){
type:"POST",
success:function(data){
2017-03-30
在慕课网页面可以执行,但是本地代码不报错,但是点击以后出现错误:
XMLHttpRequest cannot load file:///D:/qiqi/JSlearn/html/Data/http://www.imooc.com/data/sport.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
求解 为什么
XMLHttpRequest cannot load file:///D:/qiqi/JSlearn/html/Data/http://www.imooc.com/data/sport.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
求解 为什么
2017-03-29