插件地址:https://github.com/mricle/Mri...有没有用这个的同学,或者可以帮忙推荐下自己用的分业插件.这个插件的例子里面有个问题,不明白.$("#page").pagination({ pageIndex: pageIndex.value, // def:0 pageSize: pageSize.value, // def:10 total: 100, debug: true, showInfo: true, showJump: true, showPageSizes: true, loadFirstPage: true, remote: { url: 'data.json', params: $('form').serializeArray(), success: function (data) { $("#eventLog").append(' remote callback : ' + JSON.stringify(data) + '<br />'); } }});下面是data.json文件{ "total": 214, "list": ""}里面的remote下的`url: 'data.json',会显示跨域的问题.然后这种情况的跨域怎么解决?本来我想用fidder来做代理的, 可是监控不到这个请求...
1 回答

大话西游666
TA贡献1817条经验 获得超14个赞
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
不知道你描述的是不是这个错误,如果是的话,很简单。通过 http
协议访问这个文件就好了。
我本地使用的是 node 的 express web 框架,我把 github 上的内容拷贝到 public 文件夹下(也就是静态文件的目录),然后访问 http://localhost:3000/test-ajax.html
3000 是 express 的默认端口。这个 remote 可能涉及到了网络操作,所有不能直接本地用浏览器打开文件。我是这么理解的,你也可以看看网上其他人的观点。
添加回答
举报
0/150
提交
取消