<?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>Developer Oracles &#187; JavaScript</title>
	<atom:link href="http://devoracles.com/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://devoracles.com</link>
	<description></description>
	<lastBuildDate>Sun, 21 Mar 2010 11:05:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DefiThis un-minified Javascript and code explanation</title>
		<link>http://devoracles.com/defithis-un-minified-javascript-and-code-explanation/883</link>
		<comments>http://devoracles.com/defithis-un-minified-javascript-and-code-explanation/883#comments</comments>
		<pubDate>Sat, 31 Jan 2009 10:16:34 +0000</pubDate>
		<dc:creator>Gary Illyes</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[defithis]]></category>

		<guid isPermaLink="false">http://devoracles.com/?p=883</guid>
		<description><![CDATA[We published a while ago a small WordPress plugin which enables the users to look up words in a specific database, by highlighting with the mouse the word they want to look up then following a link to an administrator set online database (like Google Definition service or Dictionary.com) which will do the rest of [...]]]></description>
			<content:encoded><![CDATA[<p>We published a while ago a small WordPress plugin which enables the users to look up words in a specific database, by highlighting with the mouse the word they want to look up then following a link to an administrator set online database (like Google Definition service or Dictionary.com) which will do the rest of the job.</p>
<p>Worthless to say that this plugin is based on JavaScript in almost 80%, the rest is a bit of PHP which hooks the Javascript code to the WordPress engine and a bit of CSS to style the plugin.</p>
<p>A few words about our coding style: we almost always minify the code made by us. This means that we run a code through a compressor software which strips the unnecessary white spaces and other characters. This applies to both Javascript and CSS. This is not meant to obfuscate the code, but to preserve the bandwidth.<br />
It&#8217;s also good to know that we never use longwinded function names or variables. It&#8217;s likely that you will never see in code released by us function or variable names like:<br />
<code><br />
function this_is_a_cool_function_used_for_nothing(){<br />
}<br />
/*or variable like*/<br />
var this_is_a_useless_variable = '';<br />
</code></p>
<p>Instead, we use function and variable names like this:<br />
<code><br />
function c_D(){<br />
}<br />
/*or variable like*/<br />
var A = '';<br />
</code></p>
<p>The explanation for this habit is that long variable and function names only eats up unnecessary bandwidth, which we don&#8217;t like, and javascript understands both forms of declaration.</p>
<p>If you want to understand the functions we use, you may want to know that each function name is an abbreviation. For example the <code>R_D()</code> function is used for <strong>R</strong>endering <strong>D</strong>efithis, the <code>c()</code> function is used for <strong>C</strong>entering the widget, <code>aph()</code> for fixing <strong>A</strong>l<strong>ph</strong>a transparency in Internet Explorer, and so on.</p>
<p>So, as requested by <a href="http://devoracles.com/wp-plug-defithis#comment-915">Fernando Ramirez</a>, here&#8217;s the unminified javascript code from Defithis. Unobfuscated version does not exist since we believe it&#8217;s not obfuscated. Follow this link to the script: <a rel="nofollow" href="http://devoracles.com/examples/defithis.js">http://devoracles.com/examples/defithis.js</a></p>
<p>If you need explanation regarding anything from within the code, feel free to ask. We listen and will answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://devoracles.com/defithis-un-minified-javascript-and-code-explanation/883/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The best method to check for Internet Explorer in Javascript</title>
		<link>http://devoracles.com/the-best-method-to-check-for-internet-explorer-in-javascript/782</link>
		<comments>http://devoracles.com/the-best-method-to-check-for-internet-explorer-in-javascript/782#comments</comments>
		<pubDate>Thu, 08 Jan 2009 10:59:09 +0000</pubDate>
		<dc:creator>Gary Illyes</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://devoracles.com/?p=782</guid>
		<description><![CDATA[If you will code in Javascript, or if you already familiarized yourself with it, you encounter many times problems related to the fact that Internet Explorer doesn&#8217;t understand a lot of functions which the other browsers can. But the browser market-share dictates that we still have to code in the way to make the script [...]]]></description>
			<content:encoded><![CDATA[<p>If you will code in Javascript, or if you already familiarized yourself with it, you encounter many times problems related to the fact that Internet Explorer doesn&#8217;t understand a lot of functions which the other browsers can. But the browser market-share dictates that we still have to code in the way to make the script work on Internet Explorer, too.</p>
<p>This meant, many invented small, or relatively small functions to detect the user&#8217;s browser. Many times the function is a dozen of lines long, and it&#8217;s called every time the script needs to know whether the user&#8217;s browser is Internet Explorer or other modern browser.</p>
<p>But there&#8217;s a way better way. Better said the simplest way possible. Here it is:</p>
<p><code>var IE = /*@cc_on!@*/false;</code></p>
<p>I guess that needs a bit of explanation, right?<br />
What we see up there? I declared a new variable, called IE, which has the value a comment block followed by &#8216;<em>false</em>&#8216;.<br />
The above variable will be understood by IE: <code>var IE = !false</code>, because Internet Explorer uses JScript &#8212; a Javascript-like dialect of the standard ECMAScript &#8212; instead of Javascript which is used by all the other browsers. JScript can parse the comments, just like Internet Explorer (see <a href="http://devoracles.com/conditions-in-html/367">conditional HTML comments post</a>). This is a unique feature of IE, none of the other browsers can do it, so Firefox, Chrome, Safari, Opera, all will understand the above declaration as <code>IE = false</code>.</p>
<p>How to use this in your codes? Put the above code in the first line of your script, then when you need to know whether the browser is Internet Explorer or not, use conditions, like this:<br />
<code><br />
if(IE){<br />
//IE specific code goes here<br />
}else{<br />
//code for all the other browsers<br />
}<br />
</code></p>
<p>Hope this helps you as it helped me many times.</p>
]]></content:encoded>
			<wfw:commentRss>http://devoracles.com/the-best-method-to-check-for-internet-explorer-in-javascript/782/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery : Error: $(document).ready is not a function &#8212; Sure!</title>
		<link>http://devoracles.com/jquery-error-documentready-is-not-a-function-sure/446</link>
		<comments>http://devoracles.com/jquery-error-documentready-is-not-a-function-sure/446#comments</comments>
		<pubDate>Sun, 19 Oct 2008 19:17:20 +0000</pubDate>
		<dc:creator>Gary Illyes</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[thickbox]]></category>

		<guid isPermaLink="false">http://devoracles.com/?p=446</guid>
		<description><![CDATA[This error message appears only if another framework is in conflict with the almighty jQuery. For example You try to use Prototype/Scriptaculous for Lightbox but you also need Thickbox for something else, which requires jQuery.
Since no framework is compatible with another framework, you have to find a workaround to get things working.
And here comes jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>This error message appears only if another framework is in conflict with the almighty jQuery. For example You try to use Prototype/Scriptaculous for Lightbox but you also need Thickbox for something else, which requires jQuery.</p>
<p>Since no framework is compatible with another framework, you have to find a workaround to get things working.</p>
<p>And here comes jQuery in your help. The jQuery team was smart enough to realize that there will be conflicts between frameworks, especially the <strong>$</strong> will cause massive headaches since it&#8217;s the basic of each framework. $ is the shortcut for the word &#8220;jQuery&#8221;</p>
<p>So, they invented  <strong>jQuery.noConflict();</strong>. This will let you to replace the $ with the word jQuery, in all your code. So, when you need to call this:  $(document).ready(function(){ &#8230; You simply replace the $ as I said above: jQuery(document).ready(function(){ &#8230;, don&#8217;t forget to call jQuery.noConflict(); before this.</p>
<p>So, when you use the noConflict() function, your code should look something like this:</p>
<pre name="code" class="html">
&lt;head&gt;
  <script src="prototype.js"></script>
  <script src="jquery.js"></script>
  <script>
    jQuery.noConflict();
    jQuery(document).ready(function(){
      jQuery('div').stuff();
      //notice, that the $sign has been replaced with the word jQuery
    });
     // And you can use Prototype with $(...)
     $('id').hide();
   </script>
&lt;/head&gt;
</pre>
<p>World saved again, now you can use 2 frameworks together.</p>
]]></content:encoded>
			<wfw:commentRss>http://devoracles.com/jquery-error-documentready-is-not-a-function-sure/446/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>What do you think about the Gears Geolocation API</title>
		<link>http://devoracles.com/what-do-you-think-about-the-gears-geolocation-api/144</link>
		<comments>http://devoracles.com/what-do-you-think-about-the-gears-geolocation-api/144#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:56:03 +0000</pubDate>
		<dc:creator>Gary Illyes</dc:creator>
				<category><![CDATA[Gears 0.4]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Gears (software)]]></category>
		<category><![CDATA[Gears Geolocation API]]></category>
		<category><![CDATA[Geolocation]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Gears]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Latest stable software release/Gears]]></category>

		<guid isPermaLink="false">http://devoracles.com/?p=144</guid>
		<description><![CDATA[What you see on the top of the sidebar is not server side code. More than that, not even a bit of PHP has been used. In fact, even HTML is almost not present. It&#8217;s Gears and its GeoLocation API.
When you allow Devoracles to collect some data about you, more exactly your location on the [...]]]></description>
			<content:encoded><![CDATA[<p>What you see on the top of the sidebar is not server side code. More than that, not even a bit of PHP has been used. In fact, even HTML is almost not present. It&#8217;s Gears and its GeoLocation API.</p>
<p>When you allow Devoracles to collect some data about you, more exactly your location on the Earth, Gears queries Google about your location. Again, not even a bit of server side code on Devoracles&#8217;s side.</p>
<p>This is the GeoLocation API of Gears. And What can be used for? Think about AdSense, for the matter of the example. It always knows where you are. OK, almost always.</p>
<p>Any thoughts on this API?</p>
]]></content:encoded>
			<wfw:commentRss>http://devoracles.com/what-do-you-think-about-the-gears-geolocation-api/144/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
