I have a very strange problem. This function load a script on my IIS local web server.
function loadJs(scriptName) {
var name = scriptName.toString();
var myUrl = 'http://192.168.1.149/7.0.9.5/m/js/';
myUrl += name;
debugger;
$.ajax({
url: myUrl,
dataType: "script",
success: function () { }
});
}
When I check in debugger, I see that the url is correct.
But in fact, the ajax call doesn't use my url:
While it should be this:
We can see that the request url is not the same. (The 403 code is normal because IIS block the access to the folder list).
On the other hand, if I directly put the url into the 'url' parameter, the load works.
function loadJs(scriptName) {
var name = scriptName.toString();
var myUrl = 'http://192.168.1.149/7.0.9.5/m/js/';
myUrl += name;
debugger;
$.ajax({
url: 'http://192.168.1.149/7.0.9.5/m/js/loadAccount.js',
dataType: "script",
success: function () { }
});
}
If someone can propose an answer to this very strange problem. I'll be glad.
Thanks, in advance.
Try changing this line
myUrl = myUrl + name;
Sorry for this late answer... I found the problem, in fact I had severals scripts loaded, the first worked but the second 'scriptname' was in real empty. This justify the 403 forbidden message error (reject consultation of file in IIS).