<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tutorial Melayu &#187; print_r dalam javascript</title>
	<atom:link href="http://www.tutorialmelayu.com/tag/print_r-dalam-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tutorialmelayu.com</link>
	<description></description>
	<lastBuildDate>Sun, 06 Nov 2011 12:38:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>print_r dalam javascript</title>
		<link>http://www.tutorialmelayu.com/web-programming/javascript/print_r-dalam-javascript</link>
		<comments>http://www.tutorialmelayu.com/web-programming/javascript/print_r-dalam-javascript#comments</comments>
		<pubDate>Wed, 18 Nov 2009 19:09:24 +0000</pubDate>
		<dc:creator>mdpai</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[print_r dalam javascript]]></category>

		<guid isPermaLink="false">http://www.tutorialmelayu.com/?p=177</guid>
		<description><![CDATA[Fungsi Javascript yang fungsinya seakan fungsi print_r PHP function print_r&#40;theObj&#41;&#123; if&#40;theObj.constructor == Array &#124;&#124; theObj.constructor == Object&#41;&#123; document.write&#40;&#34;&#60;ul&#62;&#34;&#41; for&#40;var p in theObj&#41;&#123; if&#40;theObj&#91;p&#93;.constructor == Array&#124;&#124; theObj&#91;p&#93;.constructor == Object&#41;&#123; document.write&#40;&#34;&#60;li&#62;[&#34;+p+&#34;] =&#62; &#34;+typeof&#40;theObj&#41;+&#34;&#60;/li&#62;&#34;&#41;; document.write&#40;&#34;&#60;ul&#62;&#34;&#41; print_r&#40;theObj&#91;p&#93;&#41;; document.write&#40;&#34;&#60;/ul&#62;&#34;&#41; &#125; else &#123; document.write&#40;&#34;&#60;li&#62;[&#34;+p+&#34;] =&#62; &#34;+theObj&#91;p&#93;+&#34;&#60;/li&#62;&#34;&#41;; &#125; &#125; document.write&#40;&#34;&#60;/ul&#62;&#34;&#41; &#125; &#125; Selamat mencuba.]]></description>
			<content:encoded><![CDATA[<p>Fungsi Javascript yang fungsinya seakan fungsi print_r PHP</p>

<div class="wp_codebox"><table><tr id="p1772"><td class="code" id="p177code2"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> print_r<span style="color: #009900;">&#40;</span>theObj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>theObj.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> Array <span style="color: #339933;">||</span>
     theObj.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> Object<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul&gt;&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> p <span style="color: #000066; font-weight: bold;">in</span> theObj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>theObj<span style="color: #009900;">&#91;</span>p<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> Array<span style="color: #339933;">||</span>
         theObj<span style="color: #009900;">&#91;</span>p<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> Object<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;[&quot;</span><span style="color: #339933;">+</span>p<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;] =&gt; &quot;</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>theObj<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul&gt;&quot;</span><span style="color: #009900;">&#41;</span>
        print_r<span style="color: #009900;">&#40;</span>theObj<span style="color: #009900;">&#91;</span>p<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;[&quot;</span><span style="color: #339933;">+</span>p<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;] =&gt; &quot;</span><span style="color: #339933;">+</span>theObj<span style="color: #009900;">&#91;</span>p<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Selamat mencuba.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialmelayu.com/web-programming/javascript/print_r-dalam-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

