<?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>Sanjeev Shrestha &#187; JQuery</title>
	<atom:link href="http://www.sanjeevshrestha.com.np/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sanjeevshrestha.com.np</link>
	<description>Blogging on Joomla Development /Codeigniter/JQuery/Mootools/Wordpress - All Related to Web</description>
	<lastBuildDate>Sat, 27 Aug 2011 17:18:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>JQuery Plugin for Joomla</title>
		<link>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 03:08:43 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[jquery plugin]]></category>
		<category><![CDATA[jQuery plugin for Joomla]]></category>
		<category><![CDATA[jquery with mootools]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[using jquery with joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/</guid>
		<description><![CDATA[I recently released jQuery plugin for Joomla on joomlaguru.com.np. This is a simple plugin that allows user to use jQuery in Joomla and is based on my tutorial here. This plugin works in two modes and allows user a flexibility to replace or use jquery in conjunction with mootools.  This plugin is released under GNU/GPL [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/os-jquery-logo1.jpg" alt="" />I recently released <a href="http://www.joomlaguru.com.np/freebies/plugins/12-plgosjquery.html" target="_blank">jQuery plugin</a> for Joomla on <a href="http://www.joomlaguru.com.np" target="_blank">joomlaguru.com.np</a>. This is a simple plugin that allows user to use jQuery in Joomla and is based on my tutorial <a href="http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/" target="_blank">here</a>. This plugin works in two modes and allows user a flexibility to replace or use jquery in conjunction with mootools.  This plugin is released under GNU/GPL and is free as in free beer!</p>
<h2>Features</h2>
<p><strong>1. Two modes</strong></p>
<p>User can select to replace mootools with jQuery completely or use jQuery in conjunction with mootools. Using jQuery with mootools introduces noConflict features of jQuery and replaces &#8216;$&#8217; operator with jquery. This allows other libraries to use &#8216;$&#8217; operator without conflict.<span id="more-328"></span></p>
<p><!-- more --></p>
<p><strong>2. Where to use selection</strong></p>
<p>Use can select where to use jQuery. User can choose to use jQuery in frontend and/ or in administrator.</p>
<p><strong>3. Allows other application to check if jquery is loaded.</strong></p>
<p>This plugin also introduces a variable in application session that allows others to check if jquery is loaded or not. The illustration of use is as below\</p>
<blockquote>
<pre>    $app =&amp; JFactory::getApplication();

        //Check to see if jquery is already included
        if( $app-&gt;get('jquery') === true ) {

            //Code here

        }
    else
    {

    //Code here

    }</pre>
</blockquote>
<p>Here is the screenshot of plugin parameters</p>
<p><img style="max-width: 800px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/jquery-plugin-screenshot1.jpg" alt="" /></p>
<h2>License</h2>
<p>The module is released under GNU/GPL license and hence users are allowed distribute and modify the module without warranty what so ever. The developer does not bear any liability for the extension.</p>
<h2>Download</h2>
<p>Download the latest release from the download section of <a href="http://www.joomlaguru.com.np/freebies/plugins.html" target="_blank">joomlaguru.com.np</a> or you can <span class="download_link">click <a href="http://www.joomlaguru.com.np/freebies/plugins/12-plgosjquery.html" target="_blank">here</a></span> to download the plugin.</p>
<p>Send in your comments and feedbacks on the plugin. Hope you will like the plugin. Happy reading.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=371381cb-c8f5-848d-8f17-abbab3b451ee" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using jQuery with Joomla!</title>
		<link>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/#comments</comments>
		<pubDate>Fri, 08 May 2009 09:49:50 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[jquery conflict]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=203</guid>
		<description><![CDATA[Joomla ! (till Ver 1.5.10)&#160; by default supports mootools 1.11. The core is still not updated to use mootools 1.2x version. Now back to the topic. jQuery and Mootools are known to produce conflicts when used together. jQuery is more reliable and robust than mootools (It is my personal view)&#160; but it is however not [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/05/jquery-on-white.gif" />Joomla ! (till Ver 1.5.10)&nbsp; by default supports mootools 1.11. The core is still not updated to use mootools 1.2x version. </p>
<p>Now back to the topic. jQuery and Mootools are known to produce conflicts when used together. jQuery is more reliable and robust than mootools (It is my personal view)&nbsp; but it is however not provided with core joomla installation. So how to use jQuery with Mootools without any conflicts.&nbsp; <br /><span id="more-203"></span></p>
<p>To use jQuery with joomla, 
<ul>
<li>Download the latest jQuery release or any releast the best fit your requirements, </li>
<li>Save it to an accessible folder (e.g. /media/system/js/)</li>
<li>Now include the library from within your view. i.e. include the jquery library in layout file (normally default.php) of your view. </li>
</ul>
<blockquote><p>
<div class="codecontent">$document = &amp;JFactory::getDocument();<br />$document-&gt;addScript(JPATH_SITE.&#8217;/media/system/js/jquery.js&#8217; );<br />$document-&gt;<span class="method-title">addScriptDeclaration</span> ( &#8216;jQuery.noConflict();&#8217; );</div>
</blockquote>
<p>You can use jQuery with <b>jQuery.noConflict()</b> method called right after you include the jQuery library as shown above. </p>
<p>This will allow you to use the jQuery without conflicts. But what if you want to replace all the mootools library with jQuery and don&#8217;t want to use mootools at all. But remember the Joomla Administrator section uses mootools heavily so you cannot eliminate mootools from administration panel. So how to use jQuery in frontend. Here is the trick.</p>
<p>Open a file named <b>behavior.php</b>. This is under <b>libraries-&gt;joomla-&gt;html-&gt;html</b>. Now find a method named <b>mootools($debug = null)</b>. Create another function named jQuery(debug=null) and paste the code as below in the body of the function.<br />
<blockquote>function jQuery($debug = null)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; static $loaded;</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; global $mainframe;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Only load once<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($loaded) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // If no debugging value is set, use the configuration setting<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($debug === null) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $config = &amp;JFactory::getConfig();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $debug = $config-&gt;getValue(&#8216;config.debug&#8217;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $konkcheck = strpos (strtolower($_SERVER['HTTP_USER_AGENT']), &#8220;konqueror&#8221;);</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($debug || $konkcheck) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;jquery.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($mainframe-&gt;isSite()) {</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;jquery.min.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;mootools.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $loaded = true;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br />&nbsp;&nbsp;&nbsp; }</p></blockquote>
<p>Now you can use jQuery in the frontend but the admin still uses the mootools. With this method you will not face any conflicts and use jQuery without mootools.</p>
<p>The jquery.min.js is the minified version of jQuery library whereas the jquery.js is uncompressed version. Remember to put these both files under <b>media-&gt;system-&gt;js</b> folder.</p>
<p>To use jQuery in your codes just call <b>JHTML::_(&#8216;behavior.jQuery&#8217;)</b> to import jquery into your page. isn&#8217;t it cool to use jquery with joomla. I dreamt of it for long.</p>
<p>Send me comments and suggestions on this post. Happy reading</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=b7b0e418-7211-8bc8-a24e-0359a8d8d492" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.sanjeevshrestha.com.np @ 2012-05-19 15:14:29 -->
