javascript
print_r dalam javascript
Posted on .Fungsi Javascript yang fungsinya seakan fungsi print_r PHP
function print_r(theObj){
if(theObj.constructor == Array ||
theObj.constructor == Object){
document.write("
- ")
for(var p in theObj){
if(theObj[p].constructor == Array||
theObj[p].constructor == Object){
document.write("
- ["+p+"] => "+typeof(theObj)+" "); document.write("
- ["+p+"] => "+theObj[p]+" "); } } document.write("
- ")
print_r(theObj[p]);
document.write("
Selamat mencuba.
Fairuz
http://www.tutorialmelayu.comSystem Engineer (Texas Instruments France), Masters in Electronics , Embedded System Engineering,
There are no comments.