Access denied to .js file on pre-production but works on development
xmlhttp.send() in .js file does not return document that it has to return and ends up with an errorAcc开发者_StackOverflow中文版ess is Denied to that .js file itself.
Development is on 32-bit windows server 2003 , IIS6
Pre-prod is on 64-bit windows server 2008 R2, IIS7
Are you sure you have enabled IIS to serve static content? I had this issue, and it drove me nuts until I figured it out.
In "Turn Windows Features on or off", go to "Internet Information Services > World Wide Web Services > Common HTTP Features > Static Content" (for Windows 7; I imagine you'll find it in the same place on 2008 R2).
I don't know how much this will help, but also see Microsoft's documentation.
See my similar answer to an ASP.net question.
The most likely culprit here is same origin policy. XMLHTTPRequests are only allowed for resources on the same domain and port as the address of the page you're on.
If the address in your address bar is http://dev.example.com/ and the script is trying to access http://example.com/api/, the request will be denied becasuse the hostnames don't match.
I had a similar issue with IIS 7.5. I changed all permissions, etc, - nothing worked. I was using external links, and I changed this to local links - fixed. Example:
<!-- Jquery necessary files-->
<script type="text/javascript" src="http://www.mydomain.com/fancybox/jquery-1.4-jquery.min.js"></script>
This works fine
<a class="fancybox" href="autobiography.html">Read More</a>
Here is the culprit
I had originally referenced the URL as follows:
href="http://www.mydomain.com/autobiography.html"
This kept giving me access errors to the js files.
Not sure why, but it works.
Hope this helps.
加载中,请稍侯......
精彩评论