这里有个类似的问题:http://stackoverflow.com/questions/3595515/xmlhttprequest-error-origin-null-is-not-allowed-by-access-control-allow-origin
解决方案 »
- Function 对象的属性与方法
- 如何在同一个网页内通过链接打开多个FLASH?
- 我修改了JS代码,怎样才能让它立即在打开的浏览器中生效?!烦死了
- 如何用createElement 动态添加一个链接
- 请问阿信目录树如何和浮动框架结合。。。。。。
- 如何得到字符串中,字符A出现的次数?
- 怎样在网页中实现浏览器中stop按钮的功能?
- 急,急,JAVASCRIPT可否读出用户输入的URL,如果你知道,烦请告知YES OR NO!!!
- Javascript应用JQuery的样式
- Jquery 怎么实现加载完页面后自动将img和a中的地址替换
- Extjs grid中某一行字段中添加Checkbox的问题
- object text/x-scriptlet javascript 调用
用chrome刘篮球就OK了,但是用IE不行
jquery官网说的http://bugs.jquery.com/ticket/7282
List<PmcxView> qxpmList = new ArrayList<PmcxView>();
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod("http://61.142.114.227:8808/wljf/cjgl/pmcx.do?action=getQxpm&n=20");
try {
client.executeMethod(method);
if (method.getStatusCode() == HttpStatus.SC_OK) {
String jsonStr = method.getResponseBodyAsString();
JSONObject json = JSONObject.fromString(jsonStr);
JSONArray arr = (JSONArray) json.get("rows");
for(int i = 0; i < arr.length(); i++) {
PmcxView p = (PmcxView) JSONObject.toBean((JSONObject) arr.get(i), PmcxView.class);
qxpmList.add(p);
} }
} catch (IOException e) {
e.printStackTrace();
} finally {
method.releaseConnection();
} return qxpmList;
}
然后再将qxpmList传到页面,OK了