<?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>Asia Connect Technology JSC &#187; Magento JQuery</title>
	<atom:link href="http://asia-connect.com.vn/tag/magento-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://asia-connect.com.vn</link>
	<description>The place for connecting you to the success</description>
	<lastBuildDate>Fri, 12 Mar 2010 03:49:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using jQuery in Magento</title>
		<link>http://asia-connect.com.vn/2009/04/using-jquery-in-magento/</link>
		<comments>http://asia-connect.com.vn/2009/04/using-jquery-in-magento/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 08:39:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento eCommerce]]></category>
		<category><![CDATA[Magento JQuery]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/demo/wordpress/?p=85</guid>
		<description><![CDATA[At work we are developing a site for a client using the Magento eCommerce software. This is my first time using it and I’m finding it fairly badass (and it’s free!). There is a lot to like about it, which we’ll probably talk about another time, but it uses Prototype for a JavaScript library. Now I’m sure Prototype is wonderful and all that, but I don’t know a lick of it. I’d rather just use the library I’ve known to come and love, jQuery. But Prototype and jQuery notoriously don’t ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/move-mini-cart-in-the-sidebar-to-the-header-or-anywhere-in-magento/' rel='bookmark' title='Permanent Link: Move mini-cart in the sidebar to the header (or anywhere) in Magento'>Move mini-cart in the sidebar to the header (or anywhere) in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/09/create-a-color-switcher-in-magento/' rel='bookmark' title='Permanent Link: Create a Color Switcher in Magento'>Create a Color Switcher in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/10/magento-flir/' rel='bookmark' title='Permanent Link: Magento FLIR'>Magento FLIR</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>At work we are developing a site for a client using the <a rel="nofollow" href="http://www.magentocommerce.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');">Magento</a> eCommerce software. This is my first time using it and I’m finding it fairly badass (and it’s free!). There is a lot to like about it, which we’ll probably talk about another time, but it uses Prototype for a JavaScript library. Now I’m sure Prototype is wonderful and all that, but I don’t know a lick of it. I’d rather just use the library I’ve known to come and love, jQuery. But Prototype and jQuery notoriously don’t get along. This is how to deal with that.</p>
<ol>
<li>The latest version of <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> comes with a somewhat outdated version of the script.aculo.us <strong>effects</strong> file, which is part of the problem. Go get the latest version (1.8.2 right now). You may want to rename it with the version number at the end, like <tt>effects-1.8.1.js</tt></li>
<li>Upload the file to [Magento]/js/scriptaculous</li>
<li>Open the file <tt>page.xml</tt> at [Magento]/app/design/frontend/default/default/layout/page.xml</li>
<li>On about line 41, there will be a line like this:
<pre><code>&lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/effects.js&lt;/script&gt;&lt;/action&gt;</code></pre>
<p>Change the file name to your new file</li>
<li>The layout files are normally cached, so you’ll need to clear that cache to see the effect take place. Log into the backend and go to System &gt; Cache Management</li>
<li>Select “refresh” from the All Cache menu and save (which should clear your cache)</li>
<li>Reload a store page and view source to make sure your new file is the one that is loading</li>
<li>Now you need to include jQuery on your page. You could add a new line to the page.xml file, or you could open the common head.phtml file at [Magneto]/app/design/frontend/default/default/template/page/html/head.phtml &#8211; and add your &lt;script&gt; for jQuery there</li>
<li>The final step is making sure that jQuery is in .noConflict(); mode. This is the final step to making sure it plays nice with Prototype</li>
<li>Now you need to set noConflict and write code in that mode. Basically you replace the normal “$” with a new shorthand ($j, in this case).
<pre><code>var $j = jQuery.noConflict();

$j(document).ready(function(){
    $j("#test").css("padding","10px");
});</code></pre>
</li>
</ol>
<p>Note, I didn’t invent this fix, I just wanted to consolidate information I found while researching this. Mostly came from the wiki and this thread, which you can reference for more information.</p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/move-mini-cart-in-the-sidebar-to-the-header-or-anywhere-in-magento/' rel='bookmark' title='Permanent Link: Move mini-cart in the sidebar to the header (or anywhere) in Magento'>Move mini-cart in the sidebar to the header (or anywhere) in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/09/create-a-color-switcher-in-magento/' rel='bookmark' title='Permanent Link: Create a Color Switcher in Magento'>Create a Color Switcher in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/10/magento-flir/' rel='bookmark' title='Permanent Link: Magento FLIR'>Magento FLIR</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/04/using-jquery-in-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
