Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

localhost :: cross domain ajax

Is there any way to tell your localhost that it can do cross domain ajax calls?

I need this for my testing.

If it is a browser specific issue i am using google chrome.

Cheers.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It's very possible. Let's start with a dev browser.

Step 1: Download Chromium

Windows -- http://www.chromium.org/getting-involved/download-chromium

Mac -- http://www.macupdate.com/app/mac/36244/chromium/

There should be a build ready to go, but these locations change over time. So if these end up with 404's do a Google search for Windows Chromium Download and you'll find it.

Step 2: Then run the executable with this flag after it. --disable-web-security

Windows -- Create a shortcut to the executable and tag this in the Properties. Or run from [CMD].

Mac -- Open up a terminal and run this straight from there with the flag.

And, you should be good to go. I also setup a quick Apache service and run through a 127.0.0.1 configured domain, but localhost should be just fine. Here's proof.

Cross-domain security block disabled

I hope this helps you!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...