Var_dump functions in JavaScript to implement code _javascript techniques

Source: Internet
Author: User
Tags print object
Found a very good JavaScript debugging method, currently see can print object/array/function/string four types, using the method and PHP Var_dump (), as long as the direct dump (variable name) can be.

Copy Code code as follows:

Dump (value, [ShowTypes])
@ param value (any) value to dump
@ param [ShowTypes] (Boolean) optional to display each key/value ' s type
@ return (Void) returns Nothing


The Dump method is based on one of the tags available in Coldfusion (<cfdump>) providing the ability to display SIM Ple and complex variables in a user friendly way this is perfect for debugging/inspecting data. There is no way to does this with JavaScript and often I had wanted a. This method would do just so allowing for a infinite amount of data nesting complete with color coding for different dat A types, the ability to show/hide the data ' s type (string/number/boolean/object/array/function), expandable and Collapsibl e Tables/keys and Cross browser support.

Click on the buttons bellow into the some examples in action, toggle the Show data Types box to the JavaScript data typing I N Action (not possible in Coldfusion).

Browser Support
Internet Explorer 6, Internet Explorer 7, Firefox 1.5, Opera 8, Safari 1.2 (MAC), Firefox (MAC)-all tested, should also Work in most other browsers

Dump examples
Official web site
Http://www.netgrow.com.au/files/javascript_dump.cfm
Related documents
Http://www.netgrow.com.au/assets/files/dump/dump.zip

In case the above address cannot be downloaded, the cloud-dwelling community downloads the address locally
Http://www.jb51.net/jiaoben/20804.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.