<?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>[SMD] - 8L0G5PH3R3 &#187; AJAX</title>
	<atom:link href="http://www.sumardi.net/category/web-development/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sumardi.net</link>
	<description>/home/smd/public_html/blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:30:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GoodBye alert()</title>
		<link>http://www.sumardi.net/2007/05/09/goodbye-alert/</link>
		<comments>http://www.sumardi.net/2007/05/09/goodbye-alert/#comments</comments>
		<pubDate>Tue, 08 May 2007 16:03:37 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/05/09/good-by-alert/</guid>
		<description><![CDATA[I have been working with Javascript and AJAX quite a bit recently. I always used alert() to debug something. At least to know that the script was able to call the method or something. This is annoying &#038; traditional way. I&#8217;m lazy to use Venkman. After doing some Googling about Firebug functionality, I found console.log(). [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F09%2Fgoodbye-alert%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F09%2Fgoodbye-alert%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I have been working with Javascript and AJAX quite a bit recently. I always used <code>alert()</code> to debug something. At least to know that the script was able to call the method or something.</p>
<p>saveBtn = dojo.widget.createWidget(&#8220;Button&#8221;, {caption: &#8220;Save Settings&#8221;}, dojo.byId(&#8220;saveBtn&#8221;));<br />
alert(saveBtn.caption);</p>
<p>This is annoying &#038; traditional way. I&#8217;m lazy to use <a href="http://www.mozilla.org/projects/venkman/">Venkman</a>. After doing some <a href="http://www.google.com">Googling</a> about <a href="http://www.firebug.com">Firebug</a> functionality, I found <code>console.log()</code>. Now, I can do same thing by using Firebug Console.</p>
<p>saveBtn = dojo.widget.createWidget(&#8220;Button&#8221;, {caption: &#8220;Save Settings&#8221;}, dojo.byId(&#8220;saveBtn&#8221;));<br />
console.log(saveBtn.caption);</p>
<p><a href="http://www.flickr.com/photos/sumardi/489961184/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/208/489961184_bdde6942e1.jpg" width="500" height="238" alt="console-log" /></a></p>
<p>At least it&#8217;s not messing up my screen. w00f! It also has different logging levels:</p>
<ul>
<li>console.debug()</li>
<li>console.info();</li>
<li>console.warn();</li>
<li>console.error();</li>
<li>console.trace();</li>
</ul>
<p>For more, <a href="http://www.getfirebug.com/console.html">Console API</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/05/09/goodbye-alert/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Toggling WordPress Sidebar</title>
		<link>http://www.sumardi.net/2007/05/02/toggling-wordpress-sidebar/</link>
		<comments>http://www.sumardi.net/2007/05/02/toggling-wordpress-sidebar/#comments</comments>
		<pubDate>Tue, 01 May 2007 19:24:25 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/05/02/toggling-wordpress-sidebar/</guid>
		<description><![CDATA[I have change the look and feel of my blog. I can say it&#8217;s simple &#38; &#8220;sexy?&#8221;. What say you? If you can see, &#8220;Archive&#8221; block on the right sidebar is hidden onload. The block will expand on mouse click. There is a simple way to do this in wordpress. Actually, you&#8217;ll need prototype (a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F02%2Ftoggling-wordpress-sidebar%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F02%2Ftoggling-wordpress-sidebar%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><iframe src="http://digg.com/tools/diggthis.php?u=http://www.sumardi.net/2007/05/02/toggling-wordpress-sidebar" frameborder="0" height="80" scrolling="no" width="60" align="left"></iframe>I have change the look and feel of my blog. I can say it&#8217;s simple &amp; &#8220;sexy?&#8221;. What say you?</p>
<p>If you can see, &#8220;Archive&#8221; block on the right sidebar is hidden onload. The block will expand on mouse click. There is a simple way to do this in <a href="http://www.wordpress.org">wordpress</a>. Actually, you&#8217;ll need <a href="http://www.prototypejs.org">prototype</a> (a javascript framework). You can include prototype.js in wordpress by using <code>wp_enqueue_script()</code>. No need to download prototype.js because it&#8217;s already in your wp-includes/js/ folder. All you need to do is to insert this code into your header.php (it should be in /wp-content/themes/&lt;your theme folder&gt;/).</p>
<p><textarea name="code" class="php">&lt;?php wp_enqueue_script(&#8216;prototype&#8217;); ?&gt;</textarea></p>
<p><span id="more-313"></span></p>
<p>Prototype is not the only script that can be loaded with <code>wp_enqueue_script()</code>. Take a look in wp-includes/script-loader.php to see some of the other scripts that <code>wp_enqueue_script()</code> can load by default.</p>
<p>Okey! We&#8217;re now able to use prototype. It means we can use all its functions and <a href="http://prototypejs.org/api/element/toggle">Element.Toggle</a> is one of them. We need to modify the sidebar.php (it depends on your theme). This is the code : </p>
<p><textarea name="code" class="php">
<li>
<h2 onclick="$('archives').toggle();" style="cursor: pointer"><?php _e('Archives'); ?></h2>
<ul id="archives" style="display:none;">
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
<p></textarea></p>
<p>In prototype, <code>$('archives')</code> is the same as <code>document.getElementById('archives')</code>. That&#8217;s it! Hope it&#8217;s useful for those who want to make their &#8220;Archive&#8221; block looks nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/05/02/toggling-wordpress-sidebar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

