Newbie Question: How do you debug Javascript in MaxMSP?
I have tried searching for this for no avail. I have writing javascript to drive dynamic creation of MaxMSP objects, and I haven't figured out how to debug the javascript running in MaxMSP. I need your awesome help! :)
what part isn't working? I generally make a small script that illustrates that I'm doing it right, then expand it from there.
I use post() statements to print out my scripts progress to the Max window....if things aren't working, you can see how far the script has progressed before you run into a problem.
One issue with this method: if the error is in a nested function, it won't print out as expected. It is easy enough to create a debug function that can easily be turned off when your not using it:
var debug = 1;
function debug(message)
{
if(var debug == 1)
{
post(message);
}
}
and then call that function just like you would a post statement:
debug('got to this point in the script');
Of course this only works with strings. You'd have to build something more elegant to deal with mixed messages(i.e. arrays).
Hope this helps.
a