<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>FaraJoomla Web Design and Development » Blog</title>
	
	<link>http://www.farajoomla.com</link>
	<description>FaraJoomla Web Design and Development</description>
	<lastBuildDate>Mon, 14 Jan 2013 05:11:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/farajoomla" /><feedburner:info uri="farajoomla" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>farajoomla</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Cross-browser transparency</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/LQnaj4v0sX0/</link>
		<comments>http://www.farajoomla.com/2010/06/cross-browser-transparency-via-css/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 17:42:02 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=365</guid>
		<description><![CDATA[How to do it? You can make any element transparent by using &#8220;opacity&#8221; property and a value the only thing is, this declration is treated totally differently in all browsers. With four separate declrations, you can cover all browsers and fortunately they don&#8217;t interfere with each other. In this example I&#8217;ve used 70% transparency: .transparent_element [...]]]></description>
				<content:encoded><![CDATA[<p>How to do it? You can make any element transparent by using &#8220;opacity&#8221; property and a value the only thing is, this declration is treated totally differently in all browsers. With four separate declrations, you can cover all browsers and fortunately they don&#8217;t interfere with each other. In this example I&#8217;ve used 70% transparency:</p>
<pre class="brush: css">
.transparent_element {
	-moz-opacity: 0.7;
	opacity: 0.7;
	-khtml-opacity: 0.7;
	filter:alpha(opacity=70);
}
</pre>
<p>Here is what each of these properties is for:</p>
<p><strong>-moz-opacity: 0.7;</strong><br />
This one is used to support old versions of the Mozilla browsers like Netscape.</p>
<p><strong>opacity: 0.7;</strong><br />
This is the current standard in CSS. It works  for all browsers supportting current standards such as  most versions of Firefox, Safari, and Opera. </p>
<p><strong>-khtml-opacity: 0.7;</strong><br />
This is for very old versions of Safari (1.x).</p>
<p><strong>filter:alpha(opacity=70);</strong><br />
And you need this one for our dear stupid IE.</p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/LQnaj4v0sX0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/06/cross-browser-transparency-via-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/06/cross-browser-transparency-via-css/</feedburner:origLink></item>
		<item>
		<title>Accordion with jQuery and CSS</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/AoqIQnoQwps/</link>
		<comments>http://www.farajoomla.com/2010/05/accordion-with-jquery-and-css/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:30:47 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=359</guid>
		<description><![CDATA[The jQuery accordion plugin works with nested lists or just nested divs. There are also some options available to specify the structure, the active element (to display at first) and to customize animation. This plugin will come in handy when you are dealing with orgonizing a good chuck of content. HTML Markup In this markup [...]]]></description>
				<content:encoded><![CDATA[<p>The jQuery accordion plugin works with nested lists or just nested divs. There are also some options available to specify the structure, the active element (to display at first) and to customize animation. </p>
<p>This plugin will come in handy when you are dealing with orgonizing a good chuck of content. </p>
<h2>HTML Markup</h2>
<p>In this markup I&#8217;m using nested divs, an &lt;h3&gt; is the heading of accordion items and a nested &lt;div class=&quot;container_accordion&quot;&gt; to show the content of each item.</p>
<pre class="brush: html">
&lt;h3 class=&quot;click_accordion&quot;&gt;&lt;a href=&quot;#&quot;&gt;Web Design&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;container_accordion&quot;&gt;
  &lt;div class=&quot;content_accordion&quot;&gt;
    &lt;h2&gt;Custom Website Designs&lt;/h2&gt;
    &lt;p&gt;If your looking for a fresh eye-catching custom website design then we can develop a professional high quality website for you which is designed to your exact specifications.&lt;/p&gt;
    &lt;p&gt;Great websites do not need to cost an arm and a leg. Our process is that of getting to know your business and proposing the best fit for you in terms of features and budget, while never compromising on quality. We simply enjoy creating beautiful websites. Find out more about our services.&lt;/p&gt;
    &lt;p&gt;Do you require a world class corporate site, a friendly welcoming community site, or even something just plain funky? Whatever your design requirements, our design and development team caters for all audiences and markets. We have a wide range of designers at our disposal all from a variety of different design backgrounds, offering you a unique and beautifully designed website. &lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<h2>CSS</h2>
<pre class="brush: css">
h3.click_accordion {
	padding: 0;	
	margin: 0 0 5px 0;
	background: url(../images/h2-bg.png) no-repeat;
	height: 46px;	line-height: 46px;
	width: 500px;
	font-size: 2em;
	font-weight: bold;
	float: left;
}

h3.click_accordion a {
	color: #fff;
	text-decoration: none;
	display: block;
	padding: 0 0 0 35px;
}

h3.click_accordion a:hover {
	background: url(../images/h2-bg.png) no-repeat;
	background-position: 0 -46px;
}

h3.active {
	background-position: 0 -92px;
}

.container_accordion {
	margin: 0 0 5px; 
	padding: 0;
	overflow: hidden;
	font-size: 1.2em;
	width: 498px;
	clear: both;
	background: #f0f0f0;
	border: 1px solid #d6d6d6;
	-webkit-border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	-moz-border-radius: 5px;
	border-bottom-right-radius: 5px;
	border-bottom-left-radius: 5px;
}
.container_accordion .content_accordion {
	padding: 20px;
}
</pre>
<h2>Setting up jQuery</h2>
<p>You can download jQuery from the jQuery site, or you can use the hosted one on Google.</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Directly after you called your jQuery, start a new &lt;script&gt; tag and start your code by using the $(document).ready event.</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
	
//open/close settings -- set default
$(&#039;.container_accordion&#039;).hide(); //Hiding and closing the containers
$(&#039;.click_accordion:first&#039;).addClass(&#039;active&#039;).next().show(); //Add &quot;active&quot; class to first item, then show/open next container

//On/Click 
$(&#039;.click_accordion&#039;).click(function(){
	if( $(this).next().is(&#039;:hidden&#039;) ) { 
		$(&#039;.click_accordion&#039;).removeClass(&#039;active&#039;).next().slideUp(); 
		$(this).toggleClass(&#039;active&#039;).next().slideDown(); 
	}
	return false;
});

});
&lt;/script&gt;
</pre>
<p><a href="http://www.farajoomla.com/demos/jquery-accordion/" class="readmore"><span>View Demo</span></a></p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/AoqIQnoQwps" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/accordion-with-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/accordion-with-jquery-and-css/</feedburner:origLink></item>
		<item>
		<title>Dropdown with jQuery and CSS</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/eBrX_7MkoZc/</link>
		<comments>http://www.farajoomla.com/2010/05/dropdown-mwith-jquery-and-css/#comments</comments>
		<pubDate>Sun, 16 May 2010 21:42:37 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=352</guid>
		<description><![CDATA[Here is a solution for a very simple drop down menu system. All you need is jQuery and these below few lines of JavaScript and CSS. The features of this menu system are: Unordered list as menu structure Absence of mouse events within html Timeout effect Cross-browser compatible (even IE 6) Multi-level and retains &#8220;trail&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p>Here is a solution for a very simple drop down menu system. All you need is jQuery and these below few lines of JavaScript and CSS.</p>
<p>The features of this menu system are:</p>
<ul>
<li>Unordered list as menu structure</li>
<li> Absence of mouse events within html</li>
<li> Timeout effect</li>
<li> Cross-browser compatible (even IE 6)</li>
<li> Multi-level and retains &ldquo;trail&rdquo;</li>
<li> Easy to adopt styling</li>
<li> Minimal JavaScript</li>
</ul>
<h2>How to do it</h2>
<p>First thing you do is to include jQuery library (before &lt;/head&gt;)</p>
<pre class="brush: javascript">
&lt;script type=&#039;text/javascript&#039; src=&#039;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&#039;&gt;&lt;/script&gt;
</pre>
<p>I am using the jQuery library hosted on google codes, but you can download your own copy of jQuery and link it to your page.</p>
<p>Next step is to include the simple drop-down menu plugin. You can either include the code before &lt;/head&gt;, or save the code as an external JavaScript fine and include a link to it in your web page.</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){

    $(&quot;ul.dropdown li&quot;).hover(function(){
    
        $(this).addClass(&quot;hover&quot;);
        $(&#039;ul:first&#039;,this).css(&#039;visibility&#039;, &#039;visible&#039;);
    
    }, function(){
    
        $(this).removeClass(&quot;hover&quot;);
        $(&#039;ul:first&#039;,this).css(&#039;visibility&#039;, &#039;hidden&#039;);
    
    });
    
    $(&quot;ul.dropdown li ul li:has(ul)&quot;).find(&quot;a:first&quot;).append(&quot; &amp;amp;amp;amp;raquo; &quot;);

});
&lt;/script&gt;
</pre>
<p><strong>Note:</strong> if you are using as an external file, then you don&#8217;t need to enclose the code in  &lt;script type=&quot;text/javascript&quot;&gt; and &lt;/script&gt;.</p>
<p>Here is the HTML markup:</p>
<pre class="brush: html">
&lt;div id=&quot;page-wrap&quot;&gt;	   	   
        &lt;ul class=&quot;dropdown&quot;&gt;
        	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Business News&lt;/a&gt;
        		&lt;ul class=&quot;sub_menu&quot;&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Companies&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Economy&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Street Sweep&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Corrections&lt;/a&gt;&lt;/li&gt;
                     &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Street Sweep&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Corrections&lt;/a&gt;&lt;/li&gt;
					 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Economy&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;International&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;The Buzz&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        		&lt;/ul&gt;
        	&lt;/li&gt;
        	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Markets&lt;/a&gt;
        		&lt;ul class=&quot;sub_menu&quot;&gt;
        			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Pre-Market Training&lt;/a&gt;&lt;/li&gt;
        			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;After Hours Training&lt;/a&gt;&lt;/li&gt;
        			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;US Stocks&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Currencies&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Euro&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;US Dollar&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;British Pound&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Pre-Market Training&lt;/a&gt;&lt;/li&gt;
        			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;After Hours Training&lt;/a&gt;&lt;/li&gt;
        			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;US Stocks&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Currencies&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Euro&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;US Dollar&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;British Pound&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        		&lt;/ul&gt;
        	&lt;/li&gt;
        	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Personal Finance&lt;/a&gt;
        		&lt;ul class=&quot;sub_menu&quot;&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Money Magazine&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Real Estate&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Jobs&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Taxes&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Autos&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Jobs&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Taxes&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Autos&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Loan Center&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Best Places to Live&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Paris&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sweeden&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ireland&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
					 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Money Magazine&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Real Estate&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Jobs&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Taxes&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Autos&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Jobs&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Taxes&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Autos&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Loan Center&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;
        				&lt;a href=&quot;#&quot;&gt;Best Places to Live&lt;/a&gt;
        				&lt;ul&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Paris&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sweeden&lt;/a&gt;&lt;/li&gt;
        					&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ireland&lt;/a&gt;&lt;/li&gt;
        				&lt;/ul&gt;
        			 &lt;/li&gt;
        			 
        		&lt;/ul&gt;
        	&lt;/li&gt;
        	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Technology&lt;/a&gt;
        		&lt;ul class=&quot;sub_menu&quot;&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Apple&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Google&lt;/a&gt;
						 &lt;ul&gt;
						 	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Gchat&lt;/a&gt;&lt;/li&gt;
							&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ad Server&lt;/a&gt;&lt;/li&gt;
							&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Analytics&lt;/a&gt;&lt;/li&gt;
						 &lt;/ul&gt;
					 &lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Techmate&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;TechTalk&lt;/a&gt;&lt;/li&gt;
        		&lt;/ul&gt;
        	&lt;/li&gt;
        	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Preferences&lt;/a&gt;
        		&lt;ul class=&quot;sub_menu&quot;&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Login&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Register&lt;/a&gt;&lt;/li&gt;
        			 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Account&lt;/a&gt;&lt;/li&gt;
        		&lt;/ul&gt;
        	&lt;/li&gt;
        &lt;/ul&gt;		
&lt;/div&gt;
</pre>
<p>And here is the CSS:</p>
<pre class="brush: css">
* 									{ margin: 0; padding: 0; }
#page-wrap							{ width: 100%; margin: 25px auto; } 
a									{ text-decoration: none; }
ul									{ list-style: none; }
p                                   { margin: 15px 0; }
ul.dropdown                         { position: relative; }
ul.dropdown li                      { font-weight: bold; float: left; zoom: 1; background: #ccc; }
ul.dropdown a:hover		            { color: #000; }
ul.dropdown a:active                { color: #ffa500; }
ul.dropdown li a                    { display: block; padding: 4px 8px; border-right: 1px solid #333;
	 								  color: #222; }
ul.dropdown li:last-child a         { border-right: none; }
ul.dropdown li.hover,
ul.dropdown li:hover                { background: #F4B737; color: black; position: relative; }
ul.dropdown li.hover a              { color: black; }
ul.dropdown ul 						{ width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li 					{ font-weight: normal; background: #f6f6f6; color: #000; 
									  border-bottom: 1px solid #ccc; float: none; }
ul.dropdown ul li a					{ border-right: none; width: 100%; display: inline-block; } 
ul.dropdown ul ul 					{ left: 100%; top: 0; }
ul.dropdown li:hover &gt; ul 			{ visibility: visible; }
</pre>
<p>That&#8217;s it.</p>
<p><a href="http://www.farajoomla.com/demos/jquery-dropdown/" class="readmore"><span>View Demo</span></a></p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/eBrX_7MkoZc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/dropdown-mwith-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/dropdown-mwith-jquery-and-css/</feedburner:origLink></item>
		<item>
		<title>Conditional Stylesheets for IE</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/XU1lnE8rM48/</link>
		<comments>http://www.farajoomla.com/2010/05/conditional-stylesheets-for-ie/#comments</comments>
		<pubDate>Fri, 14 May 2010 02:32:52 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=329</guid>
		<description><![CDATA[We all have dealt with IE issues and bugs but you don&#8217;t have to keep banging your head against the wall when you can fight with IE problems with conditional stylesheet. This way you can code hack-free and you don&#8217;t have to worry about how dangerous hacks will behave in future, you also get to [...]]]></description>
				<content:encoded><![CDATA[<p>We all have dealt with IE issues and bugs but you don&#8217;t have to keep banging your head against the wall when you can fight with IE problems with conditional stylesheet. This way you can code hack-free and you don&#8217;t have to worry about how dangerous hacks will behave in future, you also get to keep your main stylesheet clean and valid.</p>
<p>You can also use conditional tags for loading JavaScript and HTML or any other content or message in IE.</p>
<p>Conditional tags structure is the same as an HTML comment  (&lt;!&#8211; &#8211;&gt;) and all other browsers will see them as normal comments and will ignore them entirely but explorer Windows, has been programmed to recognize the special &lt;!&#8211;[if IE]&gt; syntax, resolves the if and parses the content of the conditional comment as if it were normal page content, bingo!</p>
<p><strong>Note:</strong> since conditional comments use the HTML comment structure, they can only be included in HTML files, and not in CSS files. You&#8217;d have preferred to put the special styles in the CSS file, but that&#8217;s impossible. You can also put an entire new &lt;link&gt; tag in the conditional comment referring to an extra style sheet.</p>
<h2>How it works?</h2>
<p>The code should go in the &lt;head&gt; section with all the other regular CSS &lt;link&gt; CSS files. Below are examples of different codes for different IE versions.</p>
<p><strong>Everytthing except IE</strong></p>
<pre class="brush: html">
&lt;!--[if !IE]&gt;&lt;!--&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;not-ie.css&quot; /&gt;
&lt;!--&lt;![endif]--&gt;
</pre>
<p><strong>Only IE 7</strong></p>
<pre class="brush: html">
&lt;!--[if IE 7]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie7.css&quot;&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>Only IE 6</strong></p>
<pre class="brush: html">
&lt;!--[if IE 6]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>Only IE 5</strong></p>
<pre class="brush: html">
&lt;!--[if IE 5]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie5.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>Only IE 5.5</strong></p>
<pre class="brush: html">
&lt;!--[if IE 5.5000]&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie55.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>Only IE 6 and lower</strong></p>
<pre class="brush: html">
&lt;!--[if lt IE 7]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if lte IE 6]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>IE 7 and lower</strong></p>
<pre class="brush: html">
&lt;!--[if lt IE 8]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie7-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if lte IE 7]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie7-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>IE 8 and lower</strong></p>
<pre class="brush: html">
&lt;!--[if lt IE 9]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie8-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if lte IE 8]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie8-and-down.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>IE and higher</strong></p>
<pre class="brush: html">
&lt;!--[if gt IE 5.5]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if gte IE 6]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>IE 7 and higher</strong></p>
<pre class="brush: html">
&lt;!--[if gt IE 6]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie7-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if gte IE 7]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie7-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>IE 8 and higher</strong></p>
<pre class="brush: html">
&lt;!--[if gt IE 7]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie8-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<pre class="brush: html">
&lt;!--[if gte IE 8]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie8-and-up.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p><strong>ALL versions of IE</strong></p>
<pre class="brush: html">
&lt;!--[if IE]&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;all-ie-only.css&quot; /&gt;
&lt;![endif]--&gt; 
</pre>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/XU1lnE8rM48" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/conditional-stylesheets-for-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/conditional-stylesheets-for-ie/</feedburner:origLink></item>
		<item>
		<title>Useing glob() to Find Pathnames</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/a6Wu6gyHEUo/</link>
		<comments>http://www.farajoomla.com/2010/05/useing-glob-to-find-pathnames/#comments</comments>
		<pubDate>Wed, 12 May 2010 02:47:35 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=291</guid>
		<description><![CDATA[The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells. The downside of this function is it will not work on remote files as the file to be examined must be accessible via the server&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells.</p>
<p>The downside of this function is it will not work on remote files as the file to be examined must be accessible via the server&#8217;s filesystem and it isn&#8217;t available on some systems (e.g. old Sun OS). </p>
<h2>glob()</h2>
<pre class="brush: php">
  array glob  (  string $pattern  [,  int $flags = 0  ] )
</pre>
<h2>Pattern</h2>
<p>The pattern. No tilde expansion or parameter substitution is done. </p>
<h2>Flags</h2>
<ul>
<li> GLOB_MARK &#8211; Adds a slash to each directory returned</li>
<li> GLOB_NOSORT &#8211; Return files as they appear in the directory (no sorting)</li>
<li> GLOB_NOCHECK &#8211; Return the search pattern if no files matching it were found</li>
<li> GLOB_NOESCAPE &#8211; Backslashes do not quote metacharacters</li>
<li> GLOB_BRACE &#8211; Expands {a,b,c} to match &#8216;a&#8217;, &#8216;b&#8217;, or &#8216;c&#8217;</li>
<li> GLOB_ONLYDIR &#8211; Return only directory entries which match the pattern</li>
<li> GLOB_ERR &#8211; Stop on read errors (like unreadable directories), by default errors are ignored.</li>
</ul>
<h2>Return Values</h2>
<p>Returns an array containing the matched files/directories, an empty array if no file matched or FALSE on error. <br />
  Note: On some systems it is impossible to distinguish between empty match and an error. </p>
<h2>Example</h2>
<pre class="brush: php">
  &lt;?php
  foreach (glob(&quot;*.txt&quot;) as $filename) {
  echo &quot;$filename size &quot; . filesize($filename) . &quot;\n&quot;;
  }
  ?&gt;
  </pre>
<p>It works like scandir() function but it is more capable and flexible. It can let you search for files by using patterns.</p>
<pre class="brush: php">
  $files = glob(&#039;*.php&#039;); 
  print_r($files); 
Array 
  ( 
  [0] =&gt; phptest.php 
  [1] =&gt; pi.php 
  [2] =&gt; post_output.php 
  [3] =&gt; test.php 
  ) 
</pre>
<p>And to fetch multiple file types, you should use it like this:</p>
<pre class="brush: php">
  $files = glob(&#039;*.{php,txt}&#039;, GLOB_BRACE);
  print_r($files);
  Array 
  ( 
  [0] =&gt; phptest.php 
  [1] =&gt; pi.php 
  [2] =&gt; post_output.php 
  [3] =&gt; test.php 
  [4] =&gt; log.txt 
  5] =&gt; test.txt 
  ) 
</pre>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/a6Wu6gyHEUo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/useing-glob-to-find-pathnames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/useing-glob-to-find-pathnames/</feedburner:origLink></item>
		<item>
		<title>Redirecting with .htaccess</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/WJxnxPzhGIU/</link>
		<comments>http://www.farajoomla.com/2010/05/redirecting-with-htaccess/#comments</comments>
		<pubDate>Wed, 12 May 2010 00:31:59 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=282</guid>
		<description><![CDATA[Using the following .htaccess code, you can redirect your users to another destination. In this example we are redirecting the visitors to a &#34;Under Construction&#34; page (construction.php). Make sure you upload your .htaccess files in ascii mode, sending it up as binary will break it and usually make your server unhappy and don&#8217;t forget that [...]]]></description>
				<content:encoded><![CDATA[<p>Using the following .htaccess code, you can redirect your users to another destination. In this example we are redirecting the visitors to a &quot;Under Construction&quot; page (construction.php).</p>
<p>Make sure you upload your .htaccess files in ascii mode, sending it up as binary will break it and usually make your server unhappy and don&#8217;t forget that .htaccess does not work if you&#8217;re on a windows server. Also, make sure to change &#8220;domain.com&#8221; in this example with your own website URL and you&#8217;ll be all set.</p>
<p>The code below blocks all visitors from accessing any page besides the &quot;construction.php&quot; page.</p>
<pre class="brush: text">
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/construction\.php$
RewriteRule ^(.*)$ http://domain.com/construction.php[R=307,L]
</pre>
<p>The below code sends all users to construction.php except those with the specified IP. If you need to test your website while others were locked out, then you can use the below code with your IP address. When you are done with maintaining your website you can just remove the .htaccess code and the site will be back up again immediately!</p>
<pre class="brush: text">
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^11\.111\.111\.111
RewriteCond %{REQUEST_URI} !^/construction\.php$
RewriteRule ^(.*)$ http://domain.com/construction.php [R=307,L]
</pre>
<p>By the way, you can use this website to figure out what your IP address is: <a href="http://www.ipchicken.com/" target="_blank">http://www.ipchicken.com/</a></p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/WJxnxPzhGIU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/redirecting-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/redirecting-with-htaccess/</feedburner:origLink></item>
		<item>
		<title>How jQuery Works</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/sFpKxw-zIU4/</link>
		<comments>http://www.farajoomla.com/2010/05/how-jquery-works/#comments</comments>
		<pubDate>Tue, 04 May 2010 17:31:39 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=214</guid>
		<description><![CDATA[In past JavaScript is used by developers for client side scripting, but now developers have several option to add the functionality of JavaScript by using other tool and libraries. jQuery is also one of the best libraries for adding javascript, ajax features in the application, although the same task can be performed through javascript but [...]]]></description>
				<content:encoded><![CDATA[<p>In past JavaScript is used by developers for client side scripting, but now developers have several option to add the functionality of JavaScript by using other tool and libraries. jQuery is also one of the best libraries for adding javascript, ajax features in the application, although the same task can be performed through javascript but jQuery provide the readymade easy to use functions.</p>
<h2>What is jQuery?</h2>
<p>jQuery is very rich library of functions and methods which does the same task like JavaScript but the difference is that jQuery is easy too use and give too much flexibility to the developers. The jQuery can be used in web application irrespective of the language or technology, it can be used with PHP,asp,jsp,servlets,CGI and almost all the programming languages.</p>
<p>The definition mentioned in jQuery official Web Site<br />
“jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript”</p>
<h2>The Basics</h2>
<p>This is a basic tutorial, designed to help you get started using jQuery.   If you don&#8217;t have a test page setup yet, start by creating a new HTML   page with the following contents:</p>
<pre class="brush: javascript">
&lt;!doctype html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;

    &lt;script type=&quot;text/javascript&quot;&gt;
      
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Edit the src attribute in the script tag to point to your   copy of jquery.js.  For example, if jquery.js is in the same directory as your HTML file,   you  can use: </p>
<pre class="brush: html">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;</pre>
<h2> Launching Code on Document Ready </h2>
<p>The first thing that most Javascript programmers end up doing is   adding some code to their program, similar to this: </p>
<pre class="brush: javascript">window.onload = function(){ alert(&quot;welcome&quot;); }</pre>
<p>Inside of which is the code that you want to run right when the page   is loaded. Problematically, however, the Javascript code isn&#8217;t run until   all images are finished downloading (this includes banner ads). The   reason for using window.onload in the first place is that the HTML   &#8216;document&#8217; isn&#8217;t finished loading yet, when you first try to run your   code. </p>
<p>To circumvent both problems, jQuery has a simple statement that   checks the document and waits until it&#8217;s ready to be   manipulated, known as the <a href="http://docs.jquery.com/Events#ready.28_fn_.29" title="Events">ready   event</a>: </p>
<pre class="brush: javascript">
  $(document).ready(function(){
  // Your code here
  });
</pre>
<p>Inside the ready event, add a click handler to the link:</p>
<pre class="brush: javascript">
$(document).ready(function(){
  $(&quot;a&quot;).click(function(event){
  alert(&quot;Thanks for visiting!&quot;);
  });
  });
</pre>
<p>Save your HTML file and reload the test page in your browser. Clicking the link on the page should make a browser&#8217;s alert pop-up, before leaving to go to the main jQuery page.</p>
<p>For click and most other events, you can prevent the default behaviour &#8211; here, following the link to jquery.com &#8211; by calling event.preventDefault() in the event handler:</p>
<pre class="brush: javascript">
$(document).ready(function(){
  $(&quot;a&quot;).click(function(event){
  alert(&quot;As you can see, the link no longer took you to jquery.com&quot;);
  event.preventDefault();
  });
  });
</pre>
<p><strong> Complete Example</strong></p>
<p>The following is an example of what the complete HTML file might look like if you were to use the script in your own file. Note that it links to Google&#8217;s CDN to load the jQuery core file. Also, while the custom script is included in the &lt;head&gt;, it is generally preferable to place it in a separate file and refer that file with the script element&#8217;s src attribute</p>
<pre class="brush: html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
$(&quot;a&quot;).click(function(event){
alert(&quot;As you can see, the link no longer took you to jquery.com&quot;);
event.preventDefault();
});
});

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p> Adding and Removing an HTML Class</p>
<p>Important: The remaining jQuery examples will need to be placed inside the ready event so that they are executed when the document is ready to be worked on. See Launching Code on Document Ready above for details.</p>
<p>Another common task is adding (or removing) a class.</p>
<p>First, add some style information into the &lt;head&gt; of your document, like this:</p>
<pre class="brush: css">
&lt;style type=&quot;text/css&quot;&gt;
	a.test { font-weight: bold; }
&lt;/style&gt;
[sourcecode]
&lt;p&gt;Next, add the addClass call to your script:&lt;/p&gt;
[sourcecode language=&#039;javascript&#039;]$(&quot;a&quot;).addClass(&quot;test&quot;);</pre>
<p>All your a elements will now be bold.</p>
<p>To remove the class, use removeClass</p>
<pre class="brush: javascript">$(&quot;a&quot;).removeClass(&quot;test&quot;);</pre>
<p> * (HTML allows multiple classes to be added to an element.) </p>
<h2> Special Effects</h2>
<p>In jQuery, a couple of handy effects are provided, to really make your web site stand out. To put this to the test, change the click that you added earlier to this:</p>
<pre class="brush: javascript">
$(&quot;a&quot;).click(function(event){
   event.preventDefault();
   $(this).hide(&quot;slow&quot;);
 });
</pre>
<p>Now, if you click any link, it should make itself slowly disappear.</p>
<h2>Callback and Functions</h2>
<p>A callback is a function that is passed as an argument to another function and is executed after its parent function has completed. The special thing about a callback is that functions that appear after the &quot;parent&quot; can execute before the callback executes.</p>
<p>Another important thing to know is how to properly pass the callback. This is where I have often forgotten the proper syntax.</p>
<h2>Callback without arguments</h2>
<p>For a callback with no arguments you pass it like this:</p>
<pre class="brush: javascript"> $.get(&#039;myhtmlpage.html&#039;, myCallBack);</pre>
<p><strong>Note</strong> that the second parameter here is simply the function name (but not as a string and without parentheses). Functions in Javascript are &#8216;First class citizens&#8217; and so can be passed around like variable references and executed at a later time.</p>
<h2>Callback with arguments</h2>
<p>&quot;What do you do if you have arguments that you want to pass?&quot;, you might ask yourself.</p>
<p> Wrong</p>
<p>The Wrong Way (will not work!)</p>
<pre class="brush: javascript"> $.get(&#039;myhtmlpage.html&#039;, myCallBack(param1, param2));</pre>
</p>
<p>This will not work because it calls</p>
<p>myCallBack(param1, param2)</p>
<p>and then passes the return value as the second parameter to $.get().</p>
<p> Right</p>
<p>The problem with the above example is that myCallBack(param1, param2) is evaluated before being passed as a function. Javascript and by extension jQuery expects a function pointer in cases like these. I.E. setTimeout function.</p>
<p>In the below usage, an anonymous function is created (just a block of statements) and is registered as the callback function. Note the use of &#8216;function(){&#8216;. The anonymous function does exactly one thing: calls myCallBack, with the values of param1 and param2 in the outer scope.</p>
<pre class="brush: javascript"> 
$.get(&#039;myhtmlpage.html&#039;, function(){
  myCallBack(param1, param2);
  });
</pre>
<p>param1 and param2 are evaluated as a callback when the &#8216;$.get&#8217; is done getting the page. </p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/sFpKxw-zIU4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/how-jquery-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/how-jquery-works/</feedburner:origLink></item>
		<item>
		<title>.htaccess Overview</title>
		<link>http://feedproxy.google.com/~r/farajoomla/~3/6A3F20DLzwY/</link>
		<comments>http://www.farajoomla.com/2010/05/htaccess-overview/#comments</comments>
		<pubDate>Tue, 04 May 2010 14:13:58 +0000</pubDate>
		<dc:creator>Faramarz Kolivand</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.farajoomla.com/?p=211</guid>
		<description><![CDATA[What is .htaccess? .htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn &#8216;loaded via the Apache Web Server&#8217;, then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files [...]]]></description>
				<content:encoded><![CDATA[<h2>What is .htaccess?</h2>
<p>.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn &#8216;loaded via the Apache Web Server&#8217;, then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. </p>
<h2>Things you can do with .htaccess</h2>
<p>Below are the common uses of .htaccess:
</p>
<p><strong>Error documents</strong></p>
<p>Creating custom error pages is very useful, it allows you to show web site visitors a friendly error message, for instance if a URL on your web site does not work. This avoids the unfriendly &#8217;404 File Not Found&#8217; error and allows you to display a friendly error, explaining possible solutions and guiding the visitor back into your web site content, rather than leaving them frustrated and lost. </p>
<p><strong>Redirects</strong></p>
<p> Redirects enable us to direct web site visitors from one document within your web site to another. This is useful for example, if you have moved your web site content and would like to redirect visitors from old links to the new content location. </p>
<p><strong>Password protection</strong></p>
<p>The password protection and authentication systems offered by the Apache Web Server are probably the most important use of .htaccess files. Very easily, we can password protect a directory (or multiple) of a web site which require a username and password to access. The login procedure for these secure directories is handled automatically by the web browser using a pop-up login interface (you&#8217;ve probably seen these before). Passwords are also encrypted using one of the best encryption methods available which ensures login credentials are kept secure. In this section we will discuss the details of the .htaccess authentication system, we will explain how to set-up password protection, and a variety of helpful related information, we will also explain a variety of pre-made software which can be used to accomplish these tasks. </p>
<p><strong> Deny visitors by IP address</strong></p>
<p>The visitor blocking facilities offered by the Apache Web Server enable us to deny access to specific visitors, or allow access to specific visitors. This is extremely useful for blocking unwanted visitors, or to only allow the web site owner access to certain sections of the web site, such as an administration area. </p>
<p><strong> Deny visitors by referrer</strong></p>
<p>The visitor blocking facilities offered by the Apache Web Server enable us to deny access to specific visitors based on where they have come from. If you&#8217;ve ever looked at your logs and noticed a surprising increase in traffic, yet no increases in actual file requests it&#8217;s probably someone pinching content (such as CSS files) or someone attempting to hack your web site (this may simply mean trying to find non public content).</p>
<p>Note, this functionality requires that &#8216;mod_rewrite&#8217; is enabled on your server. Due to the demands that can be placed on system resources, it is unlikely it is enabled so be sure to check with your system administrator or web hosting company. </p>
<p><strong> Hot link prevention</strong></p>
<p>Hot link prevention refers to stopping web sites that are not your own from displaying your files or content, e.g. stopping visitors from other web sites. This is most commonly used to prevent other web sites from displaying your images but it can be used to prevent people using your JavaScript or CSS (cascading style sheet) files. The problem with hot linking is it uses your bandwidth, which in turn costs money, hot linking is often referred to as &#8216;bandwidth theft&#8217;.</p>
<p>Using .htaccess we can prevent other web sites from sourcing your content, and can even display different content in turn. For example, it is common to display what is referred to as an &#8216;angry man&#8217; images instead of the desired images.</p>
<p>Note, this functionality requires that &#8216;mod_rewrite&#8217; is enabled on your server. Due to the demands that can be placed on system resources, it is unlikely it is enabled so be sure to check with your system administrator or web hosting company. </p>
<p><strong> Blocking offline browsers and &#8216;bad bots&#8217;</strong></p>
<p>Offline browsers are   pieces of software which download your web page, following the links to   your other web pages, downloading all the content and images.  The   purpose of this is innocent, so the visitor can log off the Internet and   browse the site without a connection, but the demand on the server and   bandwidth usage can be expensive.  Bad bots as they are often called   refers to programs which visit your web site, either to source content,   look for security holes or to scan for email addresses.  This is often   how your email address ends up on &#8216;Spam&#8217; databases, because they have   set a &#8216;bot&#8217; to scan the Internet and collect email addresses.  These   programs and &#8216;bots&#8217; often ignore the rules set out in &#8216;robot.txt&#8217; files. </p>
<p><strong> DirectoryIndex uses</strong></p>
<p>The directoryindex command allows you to specify a default page to display when a directory is accessed. For instance, if a visitor requests a directory on your web site, you can specify the file to load when the directory is accessed (if a filename is not specified in the initial request). For example, to display a &#8216;index.html&#8217; file rather than showing directory listings or to load a &#8216;index.php&#8217; file rather than an &#8216;index.html&#8217; file. </p>
<p><strong> Adding MIME types</strong></p>
<p>MIME types set what a file is, or rather what file extensions refer to what file types. For example, a &#8216;.html&#8217; file extension refers to a HTML document, a &#8216;.zip&#8217; file extension refers to a ZIP archive file. The server needs to know this so it knows how to deal with the file. This is often used to create custom file extension for common file types. </p>
<p><strong> Enabling SSI (Server Side Includes)</strong></p>
<p>SSI stands for server   side includes, these are special HTML tags which you can include in   your HTML documents to call CGI scripts or other HTML content.  This is   particularly useful, for example to include a navigation menu in your   HTML documents, it allows you to use one document to display the   navigation menu in all your other documents.  This saves disk space and   means if you need to update the content, you only need to modify one   file. </p>
<p><strong> Enabling CGI outside of the cgi-bin</strong></p>
<p>If your web server   does not allow you to run CGI scripts outside of the &#8216;cgi-bin&#8217;   directory, you can enable CGI.  Check with your system administrator or   web hosting company before doing so. </p>
<p><strong> Disable directory listings</strong></p>
<p>Preventing directory   listings can be very useful if for example, you have a directory   containing important &#8216;.zip&#8217; archive files or to prevent viewing of your   image directories.  Alternatively it can also be useful to enable   directory listings if they are not available on your server, for example   if you wish to display directory listings of your important &#8216;.zip&#8217;   files. </p>
<p><strong> Setting server timezone</strong></p>
<p>To set your web   servers date timezone.</p>
<p><strong>Changing server signature</strong></p>
<p>To change the server   signature which is displayed as part of the default Apache error   documents.</p>
<p><strong> Preventing access to your PHP includes</strong></p>
<p>If you have a   directory containing PHP includes, that you do not wish to be accessed   directly from the browser, there is a way of disabling the directory   using Mod_Rewrite. </p>
<p><strong> Prevent access to php.ini</strong></p>
<p>If you run the risk   of someone accessing your php.ini or php.cgi files directly through   their browsers, you can limit access to them using .htaccess. </p>
<p><strong> Forcing scripts to display as source code</strong></p>
<p>If you need to   display scripts as source code, instead of executing, for example to   allow review, this can be achieved with the Remove Handler function.</p>
<p><strong> Ensuring media files are downloaded instead of played</strong></p>
<p>It is possible to   ensure that any media files are treated as a download, rather than to be   played by the browser. </p>
<p><strong> Setting up Associations for Encoded Files</strong></p>
<p>Some browsers are   capable of uncompressing encoded information as they receive it. </p>
<p><strong> Preventing requests with invalid characters </strong></p>
<p>If you wish, you can   use Mod_Rewrite to deny requests containing invalid characters, please   be aware that with certain site setups this may break links. </p>
<img src="http://feeds.feedburner.com/~r/farajoomla/~4/6A3F20DLzwY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farajoomla.com/2010/05/htaccess-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farajoomla.com/2010/05/htaccess-overview/</feedburner:origLink></item>
	</channel>
</rss>
