How can I print a message to the error console, preferably including a variable?
For example, something like:
print(\'x=%d\', x);
One good way to do this that works cross-browser is outlined in Debugging JavaScript: Throw Away Your Alerts!.