【发布时间】:2013-03-01 10:12:58
【问题描述】:
我尝试使用此代码但无法正常工作。
$(".edit").click(function(){
$(".edit").load("another.html #user_adr");
})
当我通过 Firebug 检查时,得到这个错误:
XMLHttpRequest cannot load file://localhost/Users/Desktop/site-new/another.html. Origin null is not allowed by Access-Control-Allow-Origin.
我该如何解决?
【问题讨论】:
-
another.html #user_adr不是有效的网址 -
@dakait - 它是有效的。 jQuery 去掉空格后面的所有内容。见the docs。
-
@JamesAllardice 感谢您提供的信息...
标签: javascript jquery load click