<?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>elxsy &#187; jquery</title>
	<atom:link href="http://www.elxsy.com/category/javascript/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elxsy.com</link>
	<description>where humanity wins the fight against machines</description>
	<lastBuildDate>Mon, 15 Aug 2011 10:08:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ImHuman multilanguage and new wordpress plugin</title>
		<link>http://www.elxsy.com/2009/06/imhuman-multilanguage-and-new-wordpress-plugin/</link>
		<comments>http://www.elxsy.com/2009/06/imhuman-multilanguage-and-new-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 20:18:48 +0000</pubDate>
		<dc:creator>cenOTapH</dc:creator>
				<category><![CDATA[ImHuman]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[french]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.8]]></category>

		<guid isPermaLink="false">http://www.elxsy.com/?p=231</guid>
		<description><![CDATA[While trying to overcome problems at SuperNo's blog which were mainly due to older PHP version, I had the chance to put the project into second gear thanks to SuperNo. ImHuman now speaks french ! all you need to do is to add lang=LANG_CODE Parameters in to your request string where LANG_CODE can be en [...]

<div class="promote clear" style="background:#EDEDED"><h3>Related posts</h3><ol><li><a href='http://www.elxsy.com/2009/06/imhuman-wordpress-plugin-0-0-9-test-run/' rel='bookmark' title='ImHuman WordPress Plugin 0.0.9 Test Run'>ImHuman WordPress Plugin 0.0.9 Test Run</a></li>
<li><a href='http://www.elxsy.com/2009/07/imhuman-in-russian/' rel='bookmark' title='ImHuman in Russian'>ImHuman in Russian</a></li>
<li><a href='http://www.elxsy.com/2009/07/imhuman-in-brazilian-portuguese/' rel='bookmark' title='ImHuman in Brazilian Portuguese'>ImHuman in Brazilian Portuguese</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>While trying to overcome problems at SuperNo's <a href="http://www.superno.com/blog">blog</a> which were mainly due to older PHP version, I had the chance to put the project into second gear thanks to <strong>SuperNo</strong>. ImHuman now speaks french <img src='http://www.elxsy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ! all you need to do is to add</p>
<pre>lang=LANG_CODE</pre>
<p>Parameters in to your request string where <code>LANG_CODE</code> can be <strong>en </strong>or <strong>fr</strong> for now. If you would like to see it in your own language contact me.</p>
<p>I am going to update the repository in couple minutes. New wordpress plugin features are:</p>
<ul>
<li>Requires PHP5, reduced in size.</li>
<li>works with AJAX, Jquery mandatory.</li>
<li>No more manual imhuman_render() insertion anymore</li>
<li>Supports Multilanguage (English and French only for now)</li>
<li>No more cache or back key problems if you guess the answer wrong and go back in your browser</li>
<li>You can customize your instruction message in your own language or format also</li>
</ul>


<div class="promote clear" style="background:#EDEDED"><h3>Related posts</h3><ol><li><a href='http://www.elxsy.com/2009/06/imhuman-wordpress-plugin-0-0-9-test-run/' rel='bookmark' title='ImHuman WordPress Plugin 0.0.9 Test Run'>ImHuman WordPress Plugin 0.0.9 Test Run</a></li>
<li><a href='http://www.elxsy.com/2009/07/imhuman-in-russian/' rel='bookmark' title='ImHuman in Russian'>ImHuman in Russian</a></li>
<li><a href='http://www.elxsy.com/2009/07/imhuman-in-brazilian-portuguese/' rel='bookmark' title='ImHuman in Brazilian Portuguese'>ImHuman in Brazilian Portuguese</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.elxsy.com/2009/06/imhuman-multilanguage-and-new-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript cross library programming</title>
		<link>http://www.elxsy.com/2009/06/javascript-cross-library-programming/</link>
		<comments>http://www.elxsy.com/2009/06/javascript-cross-library-programming/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:43:25 +0000</pubDate>
		<dc:creator>cenOTapH</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[addeventlistener]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[attachevent]]></category>
		<category><![CDATA[cross browser]]></category>
		<category><![CDATA[cross library]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript library]]></category>
		<category><![CDATA[mootols]]></category>
		<category><![CDATA[onready]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[xmlhttprequest]]></category>

		<guid isPermaLink="false">http://www.elxsy.com/?p=190</guid>
		<description><![CDATA[Javascript were generally used amateourly to provide animation effects before web 2.0 attack and xmlhttprequest api. Nowadays many open source libraries are published in order to write less and do much much more.  Jquery, Prototype, Mootols, Dojo, Ext are some of the popular ones.  So why we love them, just to write less? Noo, mostly [...]

<div class="promote clear" style="background:#EDEDED"><h3>Related posts</h3><ol><li><a href='http://www.elxsy.com/2009/06/imhuman-multilanguage-and-new-wordpress-plugin/' rel='bookmark' title='ImHuman multilanguage and new wordpress plugin'>ImHuman multilanguage and new wordpress plugin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Javascript were generally used amateourly to provide animation effects before web 2.0 attack and xmlhttprequest api. Nowadays many open source libraries are published in order to write less and do much much more.  Jquery, Prototype, Mootols, Dojo, Ext are some of the popular ones.  So why we love them, just to write less? Noo, mostly they have powerful selectors.  As usual first internet explorer then Safari do not obey the language rules and change them in their personal favor. These libraries mostly eliminate the cross platform issues also.  Finally, they all wait for the document to be ready in order to be fire an event. Thus eliminates all weird AJAX and DOM actions that is dependent on DOM content. They added fancy effects to old boring text content! That is why we love and can not do without them now.</p>
<p>But they have created another problem. Lets say you are publishing some class, web software, plugin for some CMS. You may use one of these libraries but the target client may use another one or not use at all.  Furthermore this libraries are version dependant. Updates in the library may require you to update your software also. Making your software dependent on one of them decreases the product compatibility. They all have different APIs and structures no way to globalize them under a roof.  So what <strong>should you </strong>do? Make your software compatible with all of them.</p>
<p><span id="more-190"></span>Here is a simple Javascript code which can be your core.js file to operate your Javsacript functions and operations. What we are going to do is to check if any of the defined libraries already exists in the website. If it exists, why reinvent the wheel, just tell browser to run the library specific code. If none of them exists do not be lazy and write down your good old plain Javascript code to be executed.</p>
<p>What can be added to this code is to check for library versions. If some dependant functions are version dependant also, you may add the function manually or direct the script to use your plain Javascript.</p>
<h3>Sample core.js</h3>
<pre class="brush:js">/*
Yuksel Kurtbas - 2009 - www.elxsy.com
Cross Library Javascript Programming Example
*/
if (typeof(jQuery) != 'undefined' )
{
// Maybe a version check will be necessary here
// Jquery exists. Put in your jquery specific code
}
else if (typeof(Prototype) != 'undefined' )
{
// Prototype exists. Your Prototype specific code goes here
}
else
{
// No defined library exists. Good old plain Javascript goes here
function docready()
{
alert('Document Loaded');
}
document.addEventListener('DOMContentLoaded', docready, false);
}</pre>
<h3>What is document.addEventListener?</h3>
<blockquote><p><strong>addEventListener </strong>registers a single event listener on a single target. The event target may be a single node in a document, the document itself, a window, or an XMLHttpRequest.</p>
<p>To register more than one event listeners for the target, call addEventListener for the same target but with different event types or capture parameters.<br />
target.addEventListener(type, listener, useCapture);</p>
<p><span style="text-decoration: underline;"><em>type</em></span><br />
A string representing the event type to listen for.<br />
<em><span style="text-decoration: underline;">listener</span></em><br />
The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.<br />
<em><span style="text-decoration: underline;">useCapture</span></em><br />
If true, useCapture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered listener before being dispatched to any EventTargets beneath it in the DOM tree. Events which are bubbling upward through the tree will not trigger a listener designated to use capture. See DOM Level 3 Events for a detailed explanation.</p></blockquote>
<p>So in last part what we did is, We have created our own <strong>document.onReady</strong> event. We have added an event listener to the document and told it to execute the <strong>docready</strong> function when DOM contents finished loading. Event Listeners are compatible with all <strong>w3c</strong> compliant browsers.</p>
<p>Internet Explorer (of course!) uses a different method.</p>
<pre class="brush:js">element.attachEvent('onclick',doSomething);</pre>
<p>In order to achive same functionality cross browser in your plain Javascript, you should but a browser detection switch and register your events dependant on the switch.</p>
<p>To read more about events shortly and how to use this, register visit <a href="http://www.quirksmode.org/js/events_advanced.html" target="_blank">http://www.quirksmode.org/js/events_advanced.html</a></p>
<p>Note : If you use easy and lazy document.onclick = something W3c compliant browsers will warn you as "method depreciated please use addEventListener".</p>


<div class="promote clear" style="background:#EDEDED"><h3>Related posts</h3><ol><li><a href='http://www.elxsy.com/2009/06/imhuman-multilanguage-and-new-wordpress-plugin/' rel='bookmark' title='ImHuman multilanguage and new wordpress plugin'>ImHuman multilanguage and new wordpress plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.elxsy.com/2009/06/javascript-cross-library-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
