Encountering a puzzling issue with a script loading function 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 () { }
});
}
Despite confirming the correctness of the URL in the debugger, the ajax call does not utilize the expected link:
The intended URL:
We observe that the request URL is different. (The 403 code is due to IIS blocking access to folder listings).
Interestingly, manually entering the URL into the 'url' parameter results in successful loading:
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 anyone can provide insight or a solution to this peculiar problem, it would be greatly appreciated.
Thank you in advance.