I try work this code but not working.
$(".edit").click(function(){
$(".edit").load("another.html #user_adr");
})
When i check via Firebug, get this error:
XMLHttpRequest cannot load file://localhost/Users/Desktop/site-new/another.html. Origin null is not allowed by Access-Control-Allow-Origin.
How can i fix it?
Browsers have recently started treating calls to other files on the local file system as cross domain requests. Calling pages from other domains is banned by default security settings, and that's what you're running into.
Your best bet is to use a simple web server on your local machine to serve your pages instead.
No. you are performing cross-domain request . you cant do cross domain request without proper access mechanism. Cross Orgin Resource sharing
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.