dubtrackapi
dubtrackapi copied to clipboard
Logging Errors?
I'm not getting output when the bot js fails. I have the : bot.on('error', function(msg, trace) { console.log("Got an error from the virtual browser: ", msg, trace); }); inside of the bot js file.
But when I try to do some things, which I know fail since the log ceases, I don't know why.
For example, if I were to toss in some jquery into the bot file, it fails as jquery is not loaded (Im guessing). i.e. console.log("I get this message"); $.ajax({ url: "http://my.url.com/chat/add", type: "POST", ... console.log("Nothing processes afterward");
How do you debug such situations?
Side note question: Do you use Ajax in your bot js file (not the dubtrackapi file)? If so, how did you get it imported?
Thanks! Great work thus far.
Ajax is really designed to be done in the browser. For node.js it is recommended to use the request library instead of ajax/xmlhttprequest. Here's a tutorial.