I am loading a static resource file through $.getScript as below. loadTestComponents is a function defined within the example.js file. This works as expected in Chrome but it's not working in iOS Safari.
I'm getting an error:
loadTestComponents is undefined
$.getScript(getParameterByName('srURL') + '/example.js', function(data, textStatus, jqxhr) {
console.log(textStatus); // Success
console.log(jqxhr.status); // 200
console.log("Load was performed.");
console.log(data);
loadTestComponents();
});
Rory McCrossan
338k41 gold badges322 silver badges353 bronze badges
-
Does this answer your question? Safari iOS not loading Javascript file?Kinglish– Kinglish2021年06月09日 20:33:31 +00:00Commented Jun 9, 2021 at 20:33
-
in my case it is loading the script. console.log(data) shows the function. but when invoke it, its not recognisedbgk– bgk2021年06月09日 20:47:17 +00:00Commented Jun 9, 2021 at 20:47
lang-js