Tutorial Melayu

print_r dalam javascript

Introduction

user

Fairuz

System Engineer (Texas Instruments France), Masters in Electronics , Embedded System Engineering,


LATEST POSTS

Nota: git alias yang biasa digunakan 05th December, 2013

Nota: Android .gitignore 23rd February, 2013

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("
      ") print_r(theObj[p]); document.write("
    ") } else { document.write("
  • ["+p+"] => "+theObj[p]+"
  • "); } } document.write("
") } }

Selamat mencuba.

profile

Fairuz

http://www.tutorialmelayu.com

System Engineer (Texas Instruments France), Masters in Electronics , Embedded System Engineering,

There are no comments.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

View Comments (0) ...
Navigation