国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Javascript中的var_dump函數實現代碼

2024-05-06 14:14:09
字體:
來源:轉載
供稿:網友
發現了一個非常好的JavaScript調試方法,目前看到的是可以打印Object/Array/Function/String四種類型,使用方法和PHP中的var_dump()一樣,只要直接dump(變量名)即可。

代碼如下:
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
官方網址
http://www.netgrow.com.au/files/javascript_dump.cfm
相關文件
http://www.netgrow.com.au/assets/files/dump/dump.zip

以防上面的地址下載不了,錯新站長站本地下載地址
//m.survivalescaperooms.com/jiaoben/20804.html
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 贡嘎县| 商水县| 台中市| 柏乡县| 阿拉善盟| 广元市| 甘洛县| 苏尼特右旗| 图木舒克市| 若羌县| 景德镇市| 兴安盟| 错那县| 竹北市| 灵武市| 武夷山市| 德州市| 寿光市| 和龙市| 惠来县| 金华市| 晋州市| 个旧市| 绥化市| 安多县| 明水县| 南汇区| 崇明县| 塔河县| 乌兰察布市| 大姚县| 思茅市| 喀喇| 泾阳县| 花莲市| 合作市| 永城市| 界首市| 财经| 迁西县| 南投县|