<?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>SiteBuilder.ws &#187; jQuery</title>
	<atom:link href="http://www.sitebuilder.ws/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sitebuilder.ws</link>
	<description>Helping You Build, Manage and Promote Your Website!</description>
	<lastBuildDate>Tue, 07 Feb 2012 20:47:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery and Photo Gallery Conflict in Business Catalyst</title>
		<link>http://www.sitebuilder.ws/jquery-and-photo-gallery-conflict-in-business-catalyst.html</link>
		<comments>http://www.sitebuilder.ws/jquery-and-photo-gallery-conflict-in-business-catalyst.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 07:00:23 +0000</pubDate>
		<dc:creator>Scott Barnes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Business Catalyst]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SiteBuilder Interactive]]></category>

		<guid isPermaLink="false">http://www.sitebuilder.ws/?p=1178</guid>
		<description><![CDATA[The jQuery and photo gallery conflict in Business Catalyst can be solved with the jQuery NoConflict mode. Insert one line of code and do a search and replace to fix the problem.]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: left;">Photo Gallery Module in Business Catalyst Breaks jQuery Scripts</h2>
<p style="text-align: left;"><div class="col-2-3"></p>
<p><a href="#jqueryfix">Skip Straight to the Solution</a><br />
Let me set the stage for you. You&#8217;ve got a Business Catalyst website  with some jQuery functionality, which is typically a jQuery menu of some  sort. Everything is working great, then you install the Business Catalyst  photo gallery module and your jQuery menu stops working on that page. Unfortunately this is a common BC problem, but fortunately, this seems to be the biggest issue I&#8217;ve run into so far.</p>
<p style="text-align: left;">
<p style="text-align: center;"><a rel="lightbox" href="http://www.sitebuilder.ws/wp-content/uploads/2010/08/bc-photo-gallery.jpg"><img class="size-medium wp-image-1184 aligncenter framed fade_hover" title="bc-photo-gallery" src="http://www.sitebuilder.ws/wp-content/uploads/2010/08/bc-photo-gallery-300x196.jpg" alt="jQuery and Photo Gallery Conflict in Business Catalyst" width="300" height="196" /></a> </div></p>
<p style="text-align: left;"><div class="col-1-3 last"><br />
[simple_box]Business Catalyst is a great online site builder and content   management system. If you&#8217;re looking for an <a href="http://www.sitebuilder.ws/online-sitebuilder">online sitebuilder tool to build,   manage and promote your website</a>, make check out our the free trial. We   are a Business Catalyst private label partner and are Business Catalyst   Certified. Business Catalyst is Adobe&#8217;s software as a service   solution.[/simple_box]<br />
</div></p>
<h2 style="text-align: left;">Identifying the Problem</h2>
<p style="text-align: left;"><a rel="lightbox" href="http://www.sitebuilder.ws/wp-content/uploads/2010/08/bc-prototype.jpg"><img class="alignright size-medium wp-image-1190 framed fade_hover" title="bc-prototype" src="http://www.sitebuilder.ws/wp-content/uploads/2010/08/bc-prototype-300x189.jpg" alt="jquery prototype conflict" width="300" height="189" /></a>In a nutshell, the problem is a conflict between the jQuery and Prototype JavaScript libaries. Many JavaScript libraries use $ as a function or variable name, and this is the cause of the problem. FYI &#8211; the Prototype JavaScript is not inserted into your page until you add the photo gallery module, and then it is inserted inline so you won&#8217;t find it in the &lt;head&gt; section of your HTML.</p>
<p><a name="jqueryfix"></a></p>
<h2 style="text-align: left;">Fixing the jQuery Photo Gallery Conflict in Business Catalyst</h2>
<p style="text-align: left;">The solution to fix the problem is to use the the <strong>jQuery.noConflict() mode</strong>. Basically jQuery has this built in function to ensure compatibility with other JavaScript libraries. There are really 2 parts to fixing the problem. Let&#8217;s solve our problem, but keep in mind you can also <a href="http://api.jquery.com/jQuery.noConflict/" target="_blank">check out the official jQuery documentation</a>.</p>
<h3 style="text-align: left;">Step 1 &#8211; Active the jQuery.noConflict() Mode</h3>
<p style="text-align: left;">Insert the following script after you call jQuery. What the script does is replaces the $ with jQuery. It depends on your website, but it is most likely that <strong>this change will be in one or more of your Business Catalyst Site-Wide Templates</strong>.</p>
<pre>&lt;script&gt;jQuery.noConflict();&lt;/script&gt;</pre>
<p>So, it probably would look something like this example.</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
 &lt;head&gt;
 &lt;meta content="text/html; charset=utf-8" http-equiv="Content-type" /&gt;
 &lt;link media="all" type="text/css" href="css/style.css" rel="stylesheet" /&gt;
 &lt;script src="js/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
 &lt;script src="js/jquery.jcarousel.pack.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
[highlight1]&lt;script&gt;jQuery.noConflict();&lt;/script&gt;[/highlight1]
 &lt;script src="js/func.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
 &lt;/head&gt;</pre>
<h3>Step 2 &#8211; Replace the $ with jQuery</h3>
<p>In my example, I had a jQuery menu that was having the conflict, so I opened the function file (js/func.js) in Dreamweaver and did a find and replace on every instance of &#8220;$&#8221; with &#8220;jQuery&#8221;. Keep in mind you could make this say anything you want i.e. myjQuery, j$, etc., just make sure that it is the same as what you&#8217;ve declared in step 1. ([highlight1]jQuery[/highlight1].noConflict). Here is an example of my file. Keep in mind this is not the jQuery file, it is the one that does the magic. Below is a before and after screen shot of my changes. REMEMBER: Your file will be different, and depending on what jQuery magic you&#8217;ve used, you made need to do the Search and Replace change in multiple files.</p>
<p style="text-align: center;"><a rel="lightbox" href="http://www.sitebuilder.ws/wp-content/uploads/2010/08/jquery-search-replace.gif"><img class="aligncenter size-medium wp-image-1207 framed fade_hover" title="jquery-search-replace" src="http://www.sitebuilder.ws/wp-content/uploads/2010/08/jquery-search-replace-300x228.gif" alt="jquery search and replace to fix business catalyst photo gallery problem" width="300" height="228" /></a></p>
<h3 style="text-align: left;">Wrap Up</h3>
<p style="text-align: left;">I know when I first encountered this program I was stumped, so I hope this helps you out if you are having the jQuery Prototype conflict with your Business Catalyst website. Just remember, the fix is pretty straight forward:</p>
<ol>
<li>Activate the noConflict mode in jQuery</li>
<li>Replace the $ with jQuery</li>
</ol>
<p>Let me know if you have found this article helpful, or if you&#8217;ve got something to add!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitebuilder.ws/jquery-and-photo-gallery-conflict-in-business-catalyst.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

