Javascript中的var_dump函數(shù)實(shí)現(xiàn)代碼
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://chabaoo.cn/jiaoben/20804.html
- JavaScript中var關(guān)鍵字的使用詳解
- javascript定義變量時(shí)帶var與不帶var的區(qū)別分析
- javascript定義變量時(shí)加var與不加var的區(qū)別
- JavaScript中變量聲明有var和沒var的區(qū)別示例介紹
- 淺談JavaScript中定義變量時(shí)有無var聲明的區(qū)別
- javascript定義變量時(shí)有var和沒有var的區(qū)別探討
- Javascript全局變量var與不var的區(qū)別深入解析
- 在Javascript中 聲明時(shí)用"var"與不用"var"的區(qū)別
- 關(guān)于JavaScript中var聲明變量作用域的推斷
- JScript中的''var''定義變量的作用域
- JavaScript中const、var和let區(qū)別淺析
相關(guān)文章
js中回調(diào)函數(shù)的學(xué)習(xí)筆記
這篇文章主要介紹了js中回調(diào)函數(shù)的相關(guān)知識(shí),需要的朋友可以參考下2014-07-07bootstrap fileinput 插件使用項(xiàng)目總結(jié)(經(jīng)驗(yàn))
這篇文章主要介紹了bootstrap fileinput 插件使用項(xiàng)目總結(jié),是小編日常碰到的問題及解決方法,需要的朋友可以參考下2017-02-02js中字符串編碼函數(shù)escape()、encodeURI()、encodeURIComponent()區(qū)別詳解
JavaScript中有三個(gè)可以對(duì)字符串編碼的函數(shù),分別是: escape,encodeURI,encodeURIComponent,相應(yīng)3個(gè)解碼函數(shù):unescape,decodeURI,decodeURIComponent 。接下來通過本文給大家介紹三者之家的區(qū)別,感興趣的朋友一起學(xué)習(xí)吧2016-04-04JS/jQ實(shí)現(xiàn)免費(fèi)獲取手機(jī)驗(yàn)證碼倒計(jì)時(shí)效果
這篇文章主要介紹了JS/jQ實(shí)現(xiàn)免費(fèi)獲取手機(jī)驗(yàn)證碼倒計(jì)時(shí)效果的相關(guān)資料,通過定義兩個(gè)接口,發(fā)送驗(yàn)證請(qǐng)求和返回?cái)?shù)據(jù)驗(yàn)證手機(jī)號(hào)和驗(yàn)證是否一致,后臺(tái)根據(jù)接口去實(shí)現(xiàn),需要的朋友可以參考下2016-06-06基于JS實(shí)現(xiàn)操作成功之后自動(dòng)跳轉(zhuǎn)頁面
這篇文章主要介紹了基于JS實(shí)現(xiàn)操作成功之后自動(dòng)跳轉(zhuǎn)頁面的相關(guān)知識(shí),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-09-09JavaScript遞歸函數(shù)解“漢諾塔”算法代碼解析
這篇文章主要介紹了JavaScript遞歸函數(shù)解“漢諾塔”算法代碼解析,需要的朋友可以參考下2018-07-07學(xué)習(xí)JavaScript設(shè)計(jì)模式(接口)
這篇文章主要帶領(lǐng)大家學(xué)習(xí)JavaScript設(shè)計(jì)模式,其中重點(diǎn)介紹接口,舉例說明什么是接口,對(duì)接口進(jìn)行詳細(xì)剖析,感興趣的小伙伴們可以參考一下2015-11-11符合W3C網(wǎng)頁標(biāo)準(zhǔn)的iframe標(biāo)簽的使用方法
符合W3C網(wǎng)頁標(biāo)準(zhǔn)的iframe標(biāo)簽的使用方法...2007-07-07