Recently, I am working on OpenSocial-based applications. When debugging JavaScript, there is a major problem: there is no var_dump () function similar to PHP. I can print the information in the variable to see it, when debugging, you can only document continuously. write (), constantly alert ().
Recently, I am working on OpenSocial-based applications. When debugging JavaScript, there is a major problem: there is no var_dump () function similar to PHP. I can print the information in the variable to see it, when debugging, you can only document continuously. write (), constantly alert ().
However, google found a very good JavaScript debugging method. Currently, four types of Object, Array, Function, and String can be printed, similar to var_dump () in PHP, you only need to directly dump (variable name.
Dump (value, [showTypes])
@ Param value (Any) value to dump
@ Param [showTypes] (Boolean) optional to display each key/value's type
@ Return (Void) returns nothing
For more information, see here.
Http://www.netgrow.com.au/files/javascript_dump.cfm