Solved

Bypass cross origin issues on development site

Posted on 2016-11-30
3
95 Views
Last Modified: 2016-11-30
I am testing my website locally on a Mac in Firefox.

I have a Microsoft IIS server where ASP scripts are located.

My local Javascript file references a script like this:

$.get('http://www.domain.com/_script.asp', {email:email}, function(result){...

Open in new window


Of course, when I test my local website, I get Cross-Origin Request Blocked errors in Firefox. It isn't clear to me if these errors are coming from Firefox (local computer) or from the server. Or both?

At least for testing purposes, is it possible for me to bypass these errors? I don't want to permanently undo any security settings. After the website goes live I would want it as it is now. But for testing, it would be really convenient if I could access those scripts from my local development site.

Thank you.
0
Comment
Question by:bbdesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 250 total points
ID: 41907643
taken from here

Chrome has a wonderful command line argument to disable web security.  To start Chrome with web security disabled, run the following command:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security
0
 
LVL 14

Assisted Solution

by:Juan Ocasio
Juan Ocasio earned 250 total points
ID: 41907647
Try adding the following to web.config:
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>
0
 

Author Comment

by:bbdesign
ID: 41907728
web.config isn't an option for me, unfortunately, because I am on IIS 6.

I found a Firefox add-on called "cors everywhere" which seems to do the trick. Similar to the Google Chrome suggestion. I didn't realize the setting was in the browser and could be controlled in that way.

Thanks for the input!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question