復(fù)制代碼 代碼如下:dump(value, [showTypes]) @ par " /> 精品久久人人做人人爰,精品午夜一区二区三区,亚洲一区二区国产

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

Javascript中的var_dump函數(shù)實(shí)現(xiàn)代碼

發(fā)現(xiàn)了一個(gè)非常好的JavaScript調(diào)試方法,目前看到的是可以打印Object/Array/Function/String四種類型,使用方法和php中的var_dump()一樣,只要直接dump(變量名)即可。

復(fù)制代碼 代碼如下:
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 simple and complex variables in a user friendly way that is perfect for debugging/inspecting data. There is no way to do this with Javascript and often I had wanted a method to do this. This method will do just that allowing for an infinite amount of data nesting complete with color coding for different data types, the ability to show/hide the data's type (String/Number/Boolean/Object/Array/Function), expandable and collapsible tables/keys and cross browser support.

Click on the buttons bellow to see some examples in action, toggle the Show Data Types box to see Javascript data typing in 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
官方網(wǎng)址
http://www.NETgrow.com.au/files/Javascript_dump.cfm
相關(guān)文件
http://www.NETgrow.com.au/assets/files/dump/dump.zip

以防上面的地址下載不了,腳本之家本地下載地址
http://www.jb51.NET/jiaoben/20804.html

JavaScript技術(shù)Javascript中的var_dump函數(shù)實(shí)現(xiàn)代碼,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 双辽市| 枞阳县| 两当县| 吉首市| 灵丘县| 新宾| 左权县| 两当县| 永安市| 烟台市| 东乡| 抚顺县| 鹿邑县| 滨海县| 屏南县| 盱眙县| 南平市| 南江县| 正阳县| 建阳市| 庄河市| 开远市| 江安县| 杨浦区| 湟源县| 汶川县| 鹿泉市| 崇信县| 抚州市| 龙岩市| 略阳县| 兰溪市| 英德市| 洪洞县| 南阳市| 阿城市| 双流县| 三原县| 东方市| 中山市| 夏邑县|