How to dynamically load a javascript file from a server with Basic Authentication

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏