I am fairly new to Javascript and I am having trouble with the code not being executed in a $.getScript call. I've referenced Using $.getScript (jquery): code is not executed and jQuery getScript to be able to answer my questions but have not been able to resolve anything. I'm trying to build a script in order to store information on Backendless so I am trying to test out how to get information onto it first. I've hit a roadblock with trying to get the call to the Backendless.js sdk. I've put in checks in between lines to see where it does not execute. It completely misses the 4th check and skips down to 5. I'm not sure where to go from here and was wondering if anyone knew how to get the script to call the inside code, since in my first reference there was a script that was using $(function(){}). However I'm fairly certain this is not the case in mine.
require("jsdom").env("", function(err, window) {
console.log("this 1");
if (err) {
console.error(err);
return;
}
console.log("this 2");
var $ = require("jquery")(window);
console.log("this 3");
$.getScript('http://api.backendless.com/sdk/js/latest/backendless.js', function()
{
console.log("this 4");
var APPLICATION_ID = ' 0',
SECRET_KEY = ' 0',
VERSION = 'v1'; //default application version;
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
});
console.log("this 5");
});