<?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>asrar.ca &#187; JavaScript</title>
	<atom:link href="http://asrar.ca/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://asrar.ca</link>
	<description>web design news and tips, hockey ramblings, and music opinions</description>
	<lastBuildDate>Mon, 05 Oct 2009 21:27:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jQuery and checkboxes</title>
		<link>http://asrar.ca/2009/09/jquery-and-checkboxes/</link>
		<comments>http://asrar.ca/2009/09/jquery-and-checkboxes/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 19:04:12 +0000</pubDate>
		<dc:creator>asrar</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://asrar.ca/?p=210</guid>
		<description><![CDATA[Using a javascript library like jQuery can speed up your development. However sometimes you might hit a wall when doing simple things &#8220;the jQuery way&#8221;. A common example is working with checkboxes. How do we determine if the checkbox is checked or not? How do check the checkbox automatically? In regular javascript, it&#8217;s quite straight [...]]]></description>
			<content:encoded><![CDATA[<p>Using a javascript library like jQuery can speed up your development. However sometimes you might hit a wall when doing simple things &#8220;the jQuery way&#8221;.</p>
<p>A common example is working with checkboxes. How do we determine if the checkbox is checked or not? How do check the checkbox automatically?</p>
<p>In regular javascript, it&#8217;s quite straight forward:</p>
<pre>var chk = document.getElementById("myCheckbox");
if (chk.checked) {
  // the checkbox is checked..
}
</pre>
<p>In jQuery, we cannot check the &#8220;checked&#8221; property of the element, since the element is actually a jQuery object.</p>
<pre>var chk = $("#myCheckbox");
alert(chk.checked); //undefined!</pre>
<p>Though the jQuery object does not have a checked property, the checkbox itself still has the &#8220;checked&#8221; attribute. So we can test if the attribute is true or false. Luckily, jQuery has an <code>is()</code> function which does just that.</p>
<pre>var chk = $("#myCheckbox");
if (chk.is(":checked")) {
  // the checkbox is checked..
}</pre>
<p>It&#8217;s very simple but just takes a little different thinking. </p>
<p>To &#8220;check&#8221; the checkbox using jQuery, you would again do it using the &#8220;checked&#8221; attribute of the input element.</p>
<pre>
var chk = $("#myCheckbox");
chk.attr("checked", true);
</pre>
<p>That&#8217;s all there is to it, really. Hopefully this little tip will help you out. Happy programming!</p>
]]></content:encoded>
			<wfw:commentRss>http://asrar.ca/2009/09/jquery-and-checkboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nate Koechley: &#8220;Professional Frontend Engineering&#8221;</title>
		<link>http://asrar.ca/2009/03/nate-koechley-professional-frontend-engineering/</link>
		<comments>http://asrar.ca/2009/03/nate-koechley-professional-frontend-engineering/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 21:58:52 +0000</pubDate>
		<dc:creator>asrar</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://asrar.ca/?p=13</guid>
		<description><![CDATA[Here is a great overview of modern web design by Nate Koechley, front-end engineer of Yahoo. It covers using semantic HTML, progressive enhancement and unobtrusive javascript, among other things. Nate Koechley: &#8220;Professional Frontend Engineering&#8221; @ Yahoo! Video]]></description>
			<content:encoded><![CDATA[<p>Here is a great overview of modern web design by <a title="Nate Koeckley bio" href="http://nate.koechley.com/blog/about/" target="_blank">Nate Koechley</a>, front-end engineer of Yahoo. It covers using semantic HTML, progressive enhancement and unobtrusive javascript, among other things.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="460" height="322" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=12486762&amp;vid=4671445&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/7843/81860441.jpeg&amp;embed=1" /><param name="src" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><param name="flashvars" value="id=12486762&amp;vid=4671445&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/7843/81860441.jpeg&amp;embed=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="460" height="322" src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" flashvars="id=12486762&amp;vid=4671445&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/7843/81860441.jpeg&amp;embed=1" bgcolor="#000000" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://video.yahoo.com/watch/4671445/12486762">Nate Koechley: &#8220;Professional Frontend Engineering&#8221;</a> @ <a href="http://video.yahoo.com">Yahoo! Video</a></p>
]]></content:encoded>
			<wfw:commentRss>http://asrar.ca/2009/03/nate-koechley-professional-frontend-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
