<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Tycoon Talk - JavaScript Forum</title>
		<link>http://www.webmaster-talk.com//</link>
		<description>This forum is for discussion and help around Javascript programming, which is the scripting language of the Web for making websites come to life.</description>
		<language>en</language>
		<lastBuildDate>Wed, 22 May 2013 07:46:48 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://img.tycoontalk.freelancer.com/bluesky/vb_img/misc/rss.jpg</url>
			<title>Tycoon Talk - JavaScript Forum</title>
			<link>http://www.webmaster-talk.com//</link>
		</image>
		<item>
			<title><![CDATA[Revresh div's]]></title>
			<link>http://www.webmaster-talk.com//showthread.php?t=239400&amp;goto=newpost</link>
			<pubDate>Sun, 19 May 2013 04:10:17 GMT</pubDate>
			<description>There is some code to refresh divs? 
I trying number of codes without result..</description>
			<content:encoded><![CDATA[<div>There is some code to refresh divs?<br />
I trying number of codes without result..</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com//forumdisplay.php?f=94">JavaScript Forum</category>
			<dc:creator>exma</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com//showthread.php?t=239400</guid>
		</item>
		<item>
			<title>Drupal 7 - Adding Custom jQuery to Theme</title>
			<link>http://www.webmaster-talk.com//showthread.php?t=239378&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 06:49:16 GMT</pubDate>
			<description>First of all the obvious, 
you need to find your files mysite.info file in your current theme folder 
and add a line something like this: 
 
 
Code:...</description>
			<content:encoded><![CDATA[<div>First of all the obvious,<br />
you need to find your files mysite.info file in your current theme folder<br />
and add a line something like this:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">scripts[] = js/mysite-hacks.js</code><hr />
</div>Then create a new file <i>mysite-hacks.js</i> in your theme's /js/ directory and add this:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">// JavaScript Document<br />
// $Id$<br />
/**<br />
* Adds custom jQuery to your theme<br />
* <br />
*/<br />
<br />
var $j = jQuery.noConflict();<br />
<br />
$j(document).ready(function(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; alert(&quot;Testing 1...2...3&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
});</code><hr />
</div>It's necessary to create a noConflict variable as the $ symbol is protected within the Drupal framework for compatibility with other JS frameworks.<br />
<br />
Although the above does work, I've read that it is better to use an &quot;anonymous function&quot; like this:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">// JavaScript Document<br />
// $Id$<br />
/**<br />
* Adds custom jQuery to your theme<br />
* <br />
*/<br />
<br />
(function($) {<br />
&nbsp;  $().ready(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; alert(&quot;Testing 1...2...3&quot;);<br />
<br />
&nbsp; &nbsp; });<br />
})(jQuery);</code><hr />
</div>In fact, best practice is to process the anonymous function using &quot;Drupal Behaviours&quot; like this:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">// JavaScript Document<br />
// $Id$<br />
/**<br />
* Adds custom jQuery to your theme<br />
* <br />
*/<br />
<br />
<br />
(function ($) {<br />
&nbsp; &nbsp; Drupal.behaviors.myAlert = {<br />
&nbsp; &nbsp; &nbsp; &nbsp; attach: function (context) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert('Testing 1...2...3');<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; };<br />
})(jQuery);</code><hr />
</div>This is only scatching the surface of Drupal Behaviours.<br />
To dig just a little deeper try:<br />
<a href="http://mydrupalblog.lhmdesign.com/drupal-theming-jquery-basics-inc-drupal-behaviors" target="_blank">http://mydrupalblog.lhmdesign.com/dr...upal-behaviors</a><br />
<br />
or even better try:<br />
<a href="http://blog.amazeelabs.com/en/comment/118147" target="_blank">http://blog.amazeelabs.com/en/comment/118147</a><br />
<br />
Good luck.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com//forumdisplay.php?f=94">JavaScript Forum</category>
			<dc:creator>TWD</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com//showthread.php?t=239378</guid>
		</item>
	</channel>
</rss>
