We have a website that is protected by Basic Authentication and has a particular javascript file underneath it.
I want to load that javascript file from a different MVC3 site by putting details on the authentication header when loading the file and here's what I'm trying that doesn't seem to work - it's always popping up the basic authentication login dialog:
@{
Layout = null;
}
Auth test
Index
Any ideas what I should do to get the the code to work?
As you'll see from the various commented out parts - I've tried a few different ways (newer and older jQuery methods etc)!
For reference, the Base64 JS is taken from here - http://www.webtoolkit.info/javascript-base64.html as described here - http://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html
以上就是How to dynamically load a javascript file from a server with Basic Authentication的详细内容,更多请关注web前端其它相关文章!