<?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>Bagesh Singh&#039;s Blog &#187; javascript</title>
	<atom:link href="http://www.bageshsingh.com/bagesh-blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bageshsingh.com/bagesh-blog</link>
	<description>Shortest Distance to  Web Solutions &#38; Software Solutions</description>
	<lastBuildDate>Wed, 22 Feb 2012 18:42:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Create CAPTCHA Protection using PHP and AJAX</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-create-captcha-protection-using-php-and-ajax/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-create-captcha-protection-using-php-and-ajax/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:18:44 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[CAPTCHA]]></category>
		<category><![CDATA[DYNAMIC IMAGE]]></category>
		<category><![CDATA[GENERATION GD]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[SECURE SPAM]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1435</guid>
		<description><![CDATA[Download Source CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. So if you use CAPTCHA on your web site forms, this can help in stopping some bots and making life harder for other bots in accessing or using your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.webcheatsheet.com/php/scripts/ajax_captcha.zip">Download Source</a></p>
<p>CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. So if you use CAPTCHA on your web site forms, this can help in stopping some bots and making life harder for other bots in accessing or using your forms.</p>
<p>In brief the CAPTCHA protection works by generating a random string, writing it to an image, then storing the string inside of a session or by some other method. This is then checked when the form is submitted.</p>
<p>The goal of this tutorial is to demonstrate how to make your own simple CAPTCHA protection using PHP and AJAX technologies.</p>
<p>This tutorial is very simple, but if you are unfamiliar with PHP and AJAX this is a great place to start. The tutorial consists of a HTML page for presenting a simple form that will send the data, a JavaScript file for handling the Ajax functionality, and a simple PHP page that makes the actual comparison of the what is in the text box compared to what phrase was stored in the image.</p>
<ul>
<li>The AJAX HTML Page (the Front-end)</li>
<li>The JavaScript</li>
<li>The PHP Server Page (the Backend)</li>
<li>The Ways to Make It More Secure</li>
</ul>
<p><a name="#front_end"></a>The AJAX HTML Page (the Front-end)</p>
<p>The front-end of this tutorial is straight forward. We are going to create a simple HTML form with a textbox for entering the security code, dynamically generated image holding this code, a button for submitting, and a DIV that we will display the CAPTCHA test result. The following example shows how you can do that. Create a new file named captcha_test.htm, and add this code to it.</p>
<div>&lt;form id=&#8221;frmCaptcha&#8221; name=&#8221;frmCaptcha&#8221;&gt;<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td align=&#8221;left&#8221;&gt;<br />
&lt;label for=&#8221;captcha&#8221;&gt;Captcha&lt;/label&gt;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;input id=&#8221;txtCaptcha&#8221; type=&#8221;text&#8221; name=&#8221;txtCaptcha&#8221; value=&#8221;" maxlength=&#8221;10&#8243; size=&#8221;32&#8243; /&gt;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;img id=&#8221;imgCaptcha&#8221; src=&#8221;create_image.php&#8221; /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;input id=&#8221;btnCaptcha&#8221; type=&#8221;button&#8221; value=&#8221;Captcha Test&#8221; name=&#8221;btnCaptcha&#8221;<br />
onclick=&#8221;getParam(document.frmCaptcha)&#8221; /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</p>
<p>&lt;div id=&#8221;result&#8221;&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;/form&gt;</p></div>
<p>After the textbox and the button we have added the result DIV. We have given it an ID so we can address it through the DOM in our JavaScript. It can easily be a SPAN or any other HTML element that can contain text. The button onclick event will start the AJAX request to the server to make the comparison.</p>
<p>Below is a php script that generates the CAPTCHA image and set a session that stores the security code. Create a new file named create_image.php, and add this code to it.</p>
<div>&lt;?php<br />
//Start the session so we can store what the security code actually is<br />
session_start();</p>
<p>//Send a generated image to the browser<br />
create_image();<br />
exit();</p>
<p>function create_image()<br />
{<br />
//Let&#8217;s generate a totally random string using md5<br />
$md5_hash = md5(rand(0,999));<br />
//We don&#8217;t need a 32 character long string so we trim it down to 5<br />
$security_code = substr($md5_hash, 15, 5);</p>
<p>//Set the session to store the security code<br />
$_SESSION["security_code"] = $security_code;</p>
<p>//Set the image width and height<br />
$width = 100;<br />
$height = 20;</p>
<p>//Create the image resource<br />
$image = ImageCreate($width, $height);</p>
<p>//We are making three colors, white, black and gray<br />
$white = ImageColorAllocate($image, 255, 255, 255);<br />
$black = ImageColorAllocate($image, 0, 0, 0);<br />
$grey = ImageColorAllocate($image, 204, 204, 204);</p>
<p>//Make the background black<br />
ImageFill($image, 0, 0, $black);</p>
<p>//Add randomly generated string in white to the image<br />
ImageString($image, 3, 30, 3, $security_code, $white);</p>
<p>//Throw in some lines to make it a little bit harder for any bots to break<br />
ImageRectangle($image,0,0,$width-1,$height-1,$grey);<br />
imageline($image, 0, $height/2, $width, $height/2, $grey);<br />
imageline($image, $width/2, 0, $width/2, $height, $grey);</p>
<p>//Tell the browser what kind of file is come in<br />
header(&#8220;Content-Type: image/jpeg&#8221;);</p>
<p>//Output the newly created image in jpeg format<br />
ImageJpeg($image);</p>
<p>//Free up resources<br />
ImageDestroy($image);<br />
}<br />
?&gt;</p></div>
<p>If you view create_image.php in a browser, you should see a new JPEG image every time you refresh the page. You should see the black box with some letters and numbers on it. For more details how to create images on the fly read our tutorial Dynamic Image Generation.</p>
<p>The last we have to do is to include the JavaScript file that we will create on the next step.</p>
<div>&lt;script language=&#8221;JavaScript&#8221; type=&#8221;text/javascript&#8221; src=&#8221;ajax_captcha.js&#8221;&gt;&lt;/script&gt;</div>
<p><img src="http://www.webcheatsheet.com/images/uparrow.gif" alt="" width="10" height="10" border="0" /><span style="color: #999999; font-size: x-small;">Back to top</span></p>
<p><a name="javascript"></a>The JavaScript</p>
<p>The JavaScript will be placed in an external file called ajax_captcha.js. Let&#8217;s look into the JavaScript code.</p>
<p>The first function simply returns a browser specific XmlHttpRequest object. Unfortunately AJAX is supported slightly differently in IE than it is Safari, Opera and Mozilla-based browsers like Firefox. Microsoft Internet Explorer uses an Active X object while Mozilla and Safari use a native object.</p>
<div>//Gets the browser specific XmlHttpRequest Object<br />
function getXmlHttpRequestObject() {<br />
if (window.XMLHttpRequest) {<br />
return new XMLHttpRequest(); //Mozilla, Safari &#8230;<br />
} else if (window.ActiveXObject) {<br />
return new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;); //IE<br />
} else {<br />
//Display our error message<br />
alert(&#8220;Your browser doesn&#8217;t support the XmlHttpRequest object.&#8221;);<br />
}<br />
}</div>
<p>The next step we will create our XmlHttpRequest object that we can use to make the requests.</p>
<div>//Our XmlHttpRequest object<br />
var receiveReq = getXmlHttpRequestObject();</div>
<p>After that we create a function that will make the AJAX request. This function gets two parameters: the url to send to the server and a parameter to the url with the content of the input field.</p>
<div>//Initiate the AJAX request<br />
function makeRequest(url, param) {<br />
//If our readystate is either not started or finished, initiate a new request<br />
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {<br />
//Set up the connection to captcha_test.html. True sets the request to asyncronous(default)<br />
receiveReq.open(&#8220;POST&#8221;, url, true);<br />
//Set the function that will be called when the XmlHttpRequest objects state changes<br />
receiveReq.onreadystatechange = updatePage;</p>
<p>//Add HTTP headers to the request<br />
receiveReq.setRequestHeader(&#8220;Content-type&#8221;, &#8220;application/x-www-form-urlencoded&#8221;);<br />
receiveReq.setRequestHeader(&#8220;Content-length&#8221;, param.length);<br />
receiveReq.setRequestHeader(&#8220;Connection&#8221;, &#8220;close&#8221;);</p>
<p>//Make the request<br />
receiveReq.send(param);<br />
}<br />
}</p></div>
<p>At first we check if our XmlHttpRequest object is ready to make a request. If our readystate is either not started or finished then we initiate a new request. Next we open the connection to our server PHP page with the appended querystring and mark it as a &#8220;POST&#8221; request. After that we add HTTP headers to the request so that the server processes the request correctly. The next line defines the updatePage() function that will be called when we recieve the AJAX response. Finally, we actually send the request to the server.</p>
<p>The updatePage() function executes every time the state of the XmlHttpRequest object changes.</p>
<div>//Called every time our XmlHttpRequest objects state changes<br />
function updatePage() {<br />
//Check if our response is ready<br />
if (receiveReq.readyState == 4) {<br />
//Set the content of the DIV element with the response text<br />
document.getElementById(&#8216;result&#8217;).innerHTML = receiveReq.responseText;<br />
//Get a reference to CAPTCHA image<br />
img = document.getElementById(&#8216;imgCaptcha&#8217;);<br />
//Change the image<br />
img.src = &#8216;create_image.php?&#8217; + Math.random();<br />
}<br />
}</div>
<p>At first we need to make sure our response is ready. If it is, then the content of the DIV element is filled with the response text and the CAPTCHA image is changed. One other thing you must remember you must have different names for each image. For that purpose we use the random() function.</p>
<p>The last function will be called every time the form is submitted. It gets the value from the text box, sets the url and passes them as a parameters to makeRequest() function.</p>
<div>//Called every time when form is perfomed<br />
function getParam(theForm) {<br />
//Set the URL<br />
var url = &#8216;captcha.php&#8217;;<br />
//Set up the parameters of our AJAX call<br />
var postStr = theForm.txtCaptcha.name + &#8220;=&#8221; + encodeURIComponent( theForm.txtCaptcha.value );<br />
//Call the function that initiate the AJAX request<br />
makeRequest(url, postStr);<br />
}</div>
<p>That&#8217;s all. If we open our page, type the security code into the text box and click the button, our DIV element will read the CAPTCHA test result without having to refresh the page.</p>
<p><img src="http://www.webcheatsheet.com/images/uparrow.gif" alt="" width="10" height="10" border="0" /><a><span style="color: #999999; font-size: x-small;">Back to top</span></a></p>
<p><a name="backend"></a>The PHP Server Page (the Backend)</p>
<p>The server-side PHP file will make the actual comparison and return the result. This is very simple PHP page that only prints the result of the CAPTCHA test. You can add needed functionality yourselves. For example, if your HTML form will contain some other fields, you can send their data using the POST method and then output the data on the screen or add it into the database for further use.</p>
<div>&lt;?php<br />
//Continue the session<br />
session_start();</p>
<p>//Make sure that the input come from a posted form. Otherwise quit immediately<br />
if ($_SERVER["REQUEST_METHOD"] &lt;&gt; &#8220;POST&#8221;)<br />
die(&#8220;You can only reach this page by posting from the html form&#8221;);</p>
<p>//Check if the security code and the session value are not blank<br />
//and if the input text matches the stored text<br />
if ( ($_REQUEST["txtCaptcha"] == $_SESSION["security_code"]) &amp;&amp;<br />
(!empty($_REQUEST["txtCaptcha"]) &amp;&amp; !empty($_SESSION["security_code"])) ) {<br />
echo &#8220;&lt;h1&gt;Test successful!&lt;/h1&gt;&#8221;;<br />
} else {<br />
echo &#8220;&lt;h1&gt;Test failed! Try again!&lt;/h1&gt;&#8221;;<br />
}<br />
?&gt;</p></div>
<p>The session_start() simply continues the session. Then it&#8217;s just a simple text matching which is done by the if statement. If the input text matches the stored text then the success message displayed, otherwise error message. If someone is trying to outwit you, then you should probably use a more secure way besides storing the security code in a session or a cookie that always has the same name. As an example you can store this data in MySQL database.</p>
<p>Create a new file named captcha.php, and add the code from the preceding example to it. And that&#8217;s all for the server-side.</p>
<p><a name="#conclusion"></a>The Ways to Make It More Secure</p>
<p>You can see how it is easy to use PHP with Ajax technologies. This is very simple CAPTCHA test you can use but I&#8217;m sure you will think how to make it more powerful, robust and secure. In conclusion I just want to suggest some several things you can do to make it more secure:</p>
<ul>
<li>Rotate the text randomly</li>
<li>Add random spaces in between characters</li>
<li>Use a TTF fonts and change the font randomly every time</li>
<li>Use a random text and image size every time</li>
<li>Use more advanced text distortion and colors</li>
<li>Move the lines randomly</li>
<li>Store the password in a random cookie</li>
</ul>
<div id="seo_alrp_related"><h2>Posts Related to How to Create CAPTCHA Protection using PHP and AJAX </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/using-jquery-ajax-to-call-asp-net-json-web-service/" rel="bookmark">Using jQuery Ajax to call ASP.NET JSON web service</a></h3><p>The jQuery Ajax infrastructure allows you to perform asynchronous HTTP requests which makes it easy to call an ASP.NET JSON web service, using this api. ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/create-a-twitter-ajax-button-with-mootools-jquery-or-dojo/" rel="bookmark">Create a Twitter AJAX Button with MooTools, jQuery, or Dojo</a></h3><p>There's nothing like a subtle, slick website widget that effectively uses CSS and JavaScript to enhance the user experience.  Of course widgets like that take ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/05/a-easy-captcha-component-implentation-into-cakephp/" rel="bookmark">A easy captcha component implentation into cakephp.</a></h3><p>First save the code below into a file called captcha.php and put it in your controller components folder Then very important create a folder called ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/customize-the-display-of-error-messages-while-using-the-jquery-validation-plugin/" rel="bookmark">Customize the Display of Error Messages while using the jQuery Validation Plugin</a></h3><p>Here’s a simple way to customize the placement of the error labels while using the jQuery Validation Plugin. We will display the error message in ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-create-captcha-protection-using-php-and-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Pass  JavaScript variables to PHP</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:17:22 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[SCRIPTS GET]]></category>
		<category><![CDATA[VARIABLES PASSING]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1433</guid>
		<description><![CDATA[JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn&#8217;t have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications. One of the frequent problems is defining visitor’s screen [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn&#8217;t have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications.</p>
<p>One of the frequent problems is defining visitor’s screen resolution using JavaScript tools and passing this data to PHP-script. The following script provides solution for this problem:</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>width = screen.width;<br />
height = screen.height;</p>
<p>if (width &gt; 0 &amp;&amp; height &gt;0) {<br />
window.location.href = &#8220;http://localhost/main.php?width=&#8221; + width + &#8220;&amp;height=&#8221; + height;<br />
} else<br />
exit();</p>
<p>&lt;/script&gt;</p></div>
</div>
</td>
</tr>
</tbody>
</table>
<p>Copy and paste this code snippet in the text editor, save it as index.htm and run it in your browser. After this code has been executed, a user is automatically redirected to the main.php page where screen resolution is displayed in the browser window.</p>
<p>The main.php looks as follows:</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>&lt;?php<br />
echo &#8220;&lt;h1&gt;Screen Resolution:&lt;/h1&gt;&#8221;;<br />
echo &#8220;Width  : &#8220;.$_GET['width'].&#8221;&lt;br&gt;&#8221;;<br />
echo &#8220;Height : &#8220;.$_GET['height'].&#8221;&lt;br&gt;&#8221;;<br />
?&gt;</div>
</div>
</td>
</tr>
</tbody>
</table>
<p>As you can see, passing JavaScript variables in PHP is similar to sending data using GET method.</p>
<div id="seo_alrp_related"><h2>Posts Related to How to Pass  JavaScript variables to PHP</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-pass-javascript-variable-to-php/" rel="bookmark">how to Pass javascript variable to PHP</a></h3><p>There is lots of way to pass the php script data in javascript like simply echoing php varible in PHP. Yes you can simply echo ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-third-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Third Part of Jquery Interview question</a></h3><p>How to write a script for “Select” lists using JavaScript? 1. To remove an item from a list set it to null mySelectObject.options[3] = null ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/innovative-gateway-api-code-innovative-gateway-integration/" rel="bookmark">Innovative Gateway API CODE  | Innovative Gateway Integration</a></h3><p>Gateway Toolkits Windows API Windows Client Install including MS Installer v1.0.0.5 Windows Client Install including MS Installer v1.0.0.4 Windows Client Objects v1.0.0.4 Windows Client ASP ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-second-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Second Part of Jquery Interview question</a></h3><p>What is JavaScript? JavaScript is a general-purpose programming language designed to let programmers of all skill levels control the behavior of software objects. The language ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/expand-a-textbox-on-focus-using-jquery/" rel="bookmark">Expand a TextBox on Focus using jQuery</a></h3><p>Here’s how to animate and expand the height and width of a TextBox when it receives focus. After a delay, the TextBox returns to its ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Your CSS and JavaScript Files From Being Cached</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/11/prevent-your-css-and-javascript-files-from-being-cached/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/11/prevent-your-css-and-javascript-files-from-being-cached/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 17:23:48 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=932</guid>
		<description><![CDATA[Some websites use highly volatile, oft-changing CSS and JavaScript files. In the case of these files, it&#8217;s important that the developer prevent browsers from caching them. How do we do that? By using a phantom querystring, of course. We&#8217;ll use PHP to tack the current time onto the file reference. The PHP &#60;link href=&#8221;/stylesheet.css?&#60;?php echo [...]]]></description>
			<content:encoded><![CDATA[<div>Some websites use highly volatile, oft-changing CSS and JavaScript files. In the case of these files, it&#8217;s important that the developer prevent browsers from caching them. How do we do that? By using a phantom querystring, of course. We&#8217;ll use PHP to tack the current time onto the file reference.</div>
<p><a name="more"></a></p>
<h2>The PHP</h2>
<div>
<div>&lt;link href=&#8221;/stylesheet.css?&lt;?php echo time(); ?&gt;&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&amp;glt;</div>
<div>&lt;&#8211; RENDERS &#8211;&gt;</div>
<div>&lt;link href=&#8221;/stylesheet.css?1234567890&#8243; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&amp;glt;</div>
<div>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/site-script.js?&lt;?php echo time(); ?&gt;&#8221;&gt;&lt;/script&gt;</div>
<div>&lt;&#8211; RENDERS &#8211;&gt;</div>
<div>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/site-script.js?1234567890&#8243;&gt;&lt;/script&gt;</div>
<div>It&#8217;s a very simple technique and doesn&#8217;t affect your CSS or JavaScript code in any way.</div>
</div>
<div id="seo_alrp_related"><h2>Posts Related to Prevent Your CSS and JavaScript Files From Being Cached</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/uploading-largebig-files-in-php-using-htaccess-2/" rel="bookmark">Uploading large(big) files in PHP using .htaccess</a></h3><p>I’ve seen that many of my friends are struggling with the uploads of the bigger or larger files in PHP. After looking at their struggle, ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/collection-of-robots-txt-files/" rel="bookmark">Collection of Robots.txt Files</a></h3><p>The implementation of a suitable robots.txt file is very important for search engine optimization. There is plenty of advice around the Internet for the creation ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-pass-javascript-variable-to-php/" rel="bookmark">how to Pass javascript variable to PHP</a></h3><p>There is lots of way to pass the php script data in javascript like simply echoing php varible in PHP. Yes you can simply echo ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-work-with-directories-in-php/" rel="bookmark">how to work with Directories in php</a></h3><p>As is necessary for any language, PHP has a complete set of directory support functions. PHP gives you a variety of functions to read and ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/6-reasons-to-use-javascript-libraries-frameworks/" rel="bookmark">6 Reasons To Use JavaScript Libraries &#038; Frameworks</a></h3><p>I've seen many articles around the internet from JavaScript fundamentalists that advocate writing your own JavaScript code instead of using JavaScript frameworks like MooTools, Prototype / Scriptaculous,jQuery, MochiKit, YUI Library, ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/11/prevent-your-css-and-javascript-files-from-being-cached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>6 Reasons To Use JavaScript Libraries &amp; Frameworks</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/11/6-reasons-to-use-javascript-libraries-frameworks/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/11/6-reasons-to-use-javascript-libraries-frameworks/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 17:15:14 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[Frameworks]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/2010/11/6-reasons-to-use-javascript-libraries-frameworks/</guid>
		<description><![CDATA[I&#8217;ve seen many articles around the internet from JavaScript fundamentalists that advocate writing your own JavaScript code instead of using JavaScript frameworks like MooTools, Prototype / Scriptaculous,jQuery, MochiKit, YUI Library, and Dojo Toolkit, and I just cannot agree with their reasons for not using these spectacular frameworks. Among other reasons, fundamentalists state: You don&#8217;t learn the deep-down JavaScript code because you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<div>I&#8217;ve seen many articles around the internet from JavaScript fundamentalists that advocate writing your own JavaScript code instead of using JavaScript frameworks like <a rel="nofollow" href="http://mootools.net/" target="_blank">MooTools</a>, <a rel="nofollow" href="http://www.prototypejs.org/" target="_blank">Prototype</a> / <a rel="nofollow" href="http://script.aculo.us/" target="_blank">Scriptaculous</a>,<a rel="nofollow" href="http://jquery.com/" target="_blank">jQuery</a>, <a rel="nofollow" href="http://mochikit.com/" target="_blank">MochiKit</a>, <a rel="nofollow" href="http://developer.yahoo.com/yui/" target="_blank">YUI Library</a>, and <a rel="nofollow" href="http://dojotoolkit.org/" target="_blank">Dojo Toolkit</a>, and I just cannot agree with their reasons for not using these spectacular frameworks.</div>
<p><a name="more"></a></p>
<div>Among other reasons, fundamentalists state:</div>
<ul>
<li>You don&#8217;t learn the deep-down JavaScript code because you&#8217;re using shortcut functions within the framework</li>
<li>Javascript frameworks are bloated and contain a great amount of code you will never use</li>
<li>You shouldn&#8217;t make users download more than what&#8217;s needed</li>
<li>You shouldn&#8217;t trust the code of others for your purposes <em>(if you want it done right, do it yourself mentality)</em></li>
</ul>
<div><em><br />
</em></div>
<div>Ridiculous. Don&#8217;t listen to elitists! You SHOULD use JavaScript frameworks for the most important reasons.</div>
<h2>Don&#8217;t Reinvent The Wheel</h2>
<div>Why write code that&#8217;s already been written <em>(better)</em>? A good programmer is a lazy programmer, so be lazy. The tools are there — use them.</div>
<h2>Do More With Less Code</h2>
<div>Most JavaScript frameworks provide function &#8220;chaining.&#8221; Chaining allows you to do more with less code. Less code means less maintenance time, less download time, and less coding time. Check out <a rel="nofollow" href="http://demos.mootools.net/Chain.Periodical" target="_blank">MooTools chaining</a>.</div>
<h2>Save Time — You Don&#8217;t Code Your Own OS, Do You?</h2>
<div>I love JavaScript as much as the next guy, but some programmers REALLY love developing JavaScript. Let the experts do the tough part, you take their work and make what you&#8217;d like of it.</div>
<h2>Chances Are, You Aren&#8217;t The Expert</h2>
<div>As big as any programmer&#8217;s ego is, there are people out there that are smarter, more inventive than you. Most Web Developers need to be a jack of all trades and it&#8217;s difficult to keep up with every language when you&#8217;re needed in every facet of a website&#8217;s construction and launch. The minds behind the frameworks have their eyes on JavaScript daily — trust in them.</div>
<h2>Speed Thrills</h2>
<div>The creators of these JavaScript frameworks <span style="text-decoration: line-through;">have their own private pissing contest when it comes to JavaScript speed</span> put a lot of effort into making sure their frameworks are fast. The first job of JavaScript for mass web visitor usage is to be fast — users expect accuracy, speed is the most important part. Who&#8217;s fastest today? Check out <a rel="nofollow" href="http://mootools.net/slickspeed/" target="_blank">SlickSpeed</a>.</div>
<h2>Avoid Cryptic JavaScript Base Code</h2>
<div>Why use JavaScript&#8217;s default functions when you can use a framework&#8217;s English-named functions? For example:</div>
<div>//standard JavaScript</div>
<div>document.getElementbyId(&#8216;mydiv&#8217;).style.color = &#8216;#f00&#8242;; // camel-case the style!</div>
<div>//mootools JavaScript</div>
<div>$(&#8216;mydiv&#8217;).setStyle(&#8216;color&#8217;,'#foo&#8217;);</div>
<div>These are the reasons I use JavaScript frameworks. Need I say more?</div>
<div>Do you have more reasons? Please share them!</div>
<div id="seo_alrp_related"><h2>Posts Related to 6 Reasons To Use JavaScript Libraries & Frameworks</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/javascript-sample-paging/" rel="bookmark">Javascript sample paging</a></h3><p>I search the net for hours and found none about paging that’s simple that I can just copy and paste. So I created one. Just ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/01/jquery-crash-course-training-delhi-online/" rel="bookmark">jQuery Crash Course Training Delhi/ Online</a></h3><p>Duration: 10 hours To fully understand jQuery and its applications in modern web programming, it's important to take a moment and look back at where ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/the-role-of-cakephp/" rel="bookmark">The Role of CakePHP</a></h3><p>CakePHP was critical to the projectâ€™s success. Here I emphasize what we consider are some of the main advantages of using the Framework. It offers ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/check-or-uncheck-all-in-a-group-of-checkbox-in-javascript/" rel="bookmark">Check or Uncheck All in a Group of Checkbox in JavaScript</a></h3><p>JavaScript code to be kept before head tag. 1 2 3 4 5 6 7 8 9 10 11 12 13 &lt;SCRIPT LANGUAGE="JavaScript"&gt; function CheckAll(chk) ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/01/ajax-introduction-to-ajax-web-development-training-course-overview/" rel="bookmark">AJAX &#8211; Introduction to AJAX Web Development Training Course Overview</a></h3><p>AJAX (Asynchronous Java and XML) has emerged as a powerful platform for building web applications with extensive client-side interactivity. Unlike older approaches, which require reloading ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/11/6-reasons-to-use-javascript-libraries-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery plugin: word-counter for textarea</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-plugin-word-counter-textarea/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-plugin-word-counter-textarea/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 10:43:03 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[jquery plugin]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=861</guid>
		<description><![CDATA[Sorry friends on the way of move to new home I’ve been lost from the blog as I didn’t have internet connection for few last weeks. Now, I’m back and I try to be regular as much as I can. Inspired from the new feature of wordpress 2.6.x which displays word count of each post, [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry friends on the way of move to new home I’ve been lost from the blog as I didn’t have internet connection for few last weeks. Now, I’m back and I try to be regular as much as I can. Inspired from the new feature of wordpress 2.6.x which displays word count of each post, I’ve developed jQuery plugin to display word-count of Textarea. Please note that it is word count plugin not character counter.</p>
<p><a href="http://roshanbh.com.np/examples/jquery-word-count-plugin/" target="_blank"><strong><br />
</strong></a></p>
<h4>Jquery plugin: Word-count code</h4>
<pre>jQuery.fn.wordCount = function(params)
{
   var p =  {
   counterElement:"display_count"
   };
  &amp;nbsp;var total_words;
  if(params) {
      jQuery.extend(p, params);
  &amp;nbsp;}
  //for each keypress function on text areas
 &amp;nbsp;this.keypress(function()
  {
    total_words=this.value.split(/[\s\.\?]+/).length;
   &amp;nbsp;jQuery('#'+p.counterElement).html(total_words);
  &amp;nbsp;});
};</pre>
<p><strong> </strong></p>
<p>As you can in the above code, I assume that each words of a paragraph are separated by the either spaces or dots(.) . Please have your suggestion if i can more characters to improve this plugin.</p>
<h4>How to use this plugin?</h4>
<p>Well, you can guess that a Textarea is needed of whose words are counted and another element like div or span needed to display the word count.</p>
<p>For example, the below HTML code contains Textarea (whose total word is counted) and span (for displaying counted word).</p>
<pre>&lt;textarea name="word_count" id="word_count" cols="30" rows="6"&gt;&lt;/textarea&gt;
Total word Count : &lt;span id="display_count"&gt;0&lt;/span&gt;</pre>
<p>Remember that the id of text area is “word_count” and “display_count“.</p>
<p>Now, let look at the jQuery code for displaying word count of text area , note that we are calling the function wordCount() which we’ve just developed in the plugin of jQuery.</p>
<pre>$('#word_count').wordCount();</pre>
<p><strong>Note: </strong>display_count  is default id of element which is already defined in the plugin if you want to use the different id of elment then you’ve to override the value of variable <strong>counterElement</strong> which contains the id of element displaying word count.</p>
<pre>$('#word_count').wordCount({counterElement:"word_counter"});</pre>
<p><a href="http://roshanbh.com.np/codes/jquery-word-count.zip"><strong>DOWNLOAD EXAMPLE CODE </strong></a></p>
<div id="seo_alrp_related"><h2>Posts Related to jQuery plugin: word-counter for textarea</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/03/jquery-plugin-word-counter-for-textarea/" rel="bookmark">jQuery plugin: word-counter for textarea</a></h3><p>Sorry friends on the way of move to new home I</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/sliding-letters-with-jquery/" rel="bookmark">Sliding Letters with jQuery</a></h3><p>Example In the following we will go through an example and we’ll start by the html for a little menu: 1 &lt;div class="sl_examples"&gt; 2     &lt;a ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/add-a-%e2%80%9cread-more%e2%80%9d-link-using-jquery/" rel="bookmark">Add a “Read More” Link using jQuery</a></h3><p>The jQuery Expander Plugin is a simple little jQuery plugin to hide/collapse a portion of an element's text and add a "read more" link so ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-mouseover-tooltip-plugin/" rel="bookmark">Jquery Mouseover Tooltip Plugin</a></h3><p>Let's review a topic about how to create Jquery Mouseover Tooltip Plugin. Have you ever seen Jquery Mouseover Tooltip Plugin ? ... Like this below: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jpaginate-how-to-add-a-fancy-jquery-pagination-plugin/" rel="bookmark">jPaginate: how to add a Fancy jQuery Pagination Plugin</a></h3><p>jPaginate is a jQuery pagination plugin that comes with a twist: animated page numbers. The user can slide through the available page numbers by clicking ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-plugin-word-counter-textarea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>38 jQuery And CSS Drop Down Multi Level Menu Solutions</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/07/38-jquery-and-css-drop-down-multi-level-menu-solutions/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/07/38-jquery-and-css-drop-down-multi-level-menu-solutions/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 15:54:42 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[coding technique]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=611</guid>
		<description><![CDATA[Hello again, it Posts Related to 38 jQuery And CSS Drop Down Multi Level Menu SolutionsSexy Drop Down Menu w/ jQuery &#038; CSSStudies show that top navigations tend to get the most visual attention when a user first visits a site. Having organized and intuitive navigation is ...Create a Transparent jQuery UI AutoComplete MenuLet us [...]]]></description>
			<content:encoded><![CDATA[<p>Hello again, it</p>
<div id="seo_alrp_related"><h2>Posts Related to 38 jQuery And CSS Drop Down Multi Level Menu Solutions</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/07/sexy-drop-down-menu-w-jquery-css/" rel="bookmark">Sexy Drop Down Menu w/ jQuery &#038; CSS</a></h3><p>Studies show that top navigations tend to get the most visual attention when a user first visits a site. Having organized and intuitive navigation is ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/create-a-transparent-jquery-ui-autocomplete-menu/" rel="bookmark">Create a Transparent jQuery UI AutoComplete Menu</a></h3><p>Let us quickly see how to create a Transparent jQuery UI AutoComplete Menu. Here’s some code to implement the AutoComplete Menu. We will make it ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/03/how-to-disable-context-menu-in-browsers/" rel="bookmark">How to disable context menu in browsers ?</a></h3><p>Today, I would like to share a fairly simple technique to disable right click menu of the website. I was using around 10-15 lines of ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/02/sleek-and-smooth-animated-menu-using-jquery/" rel="bookmark">Sleek and Smooth animated menu using jQuery</a></h3><p>Today, I</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/07/38-jquery-and-css-drop-down-multi-level-menu-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Creating Ajax Updated Tabs In Frontend, Like Product Management Tabs of Backend</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/06/magento-creating-ajax-updated-tabs-in-frontend-like-product-management-tabs-of-backend/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/06/magento-creating-ajax-updated-tabs-in-frontend-like-product-management-tabs-of-backend/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 11:39:44 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento interview question]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP Third Party Tools]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=603</guid>
		<description><![CDATA[Magento Posts Related to Magento: Creating Ajax Updated Tabs In Frontend, Like Product Management Tabs of BackendAdding Tabs in Product View Page Through Layout In MagentoOne of my new colleague, today asked me how to add tabs in product view page in Magento. He told me earlier he had used ...Creating Collection of Objects in [...]]]></description>
			<content:encoded><![CDATA[<p>Magento</p>
<div id="seo_alrp_related"><h2>Posts Related to Magento: Creating Ajax Updated Tabs In Frontend, Like Product Management Tabs of Backend</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/adding-tabs-in-product-view-page-through-layout-in-magento/" rel="bookmark">Adding Tabs in Product View Page Through Layout In Magento</a></h3><p>One of my new colleague, today asked me how to add tabs in product view page in Magento. He told me earlier he had used ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/creating-collection-of-objects-in-magento-using-a-%e2%80%9cmagical-class%e2%80%9dvarien_data_collection/" rel="bookmark">Creating Collection of Objects in Magento using a</a></h3><p>Have you ever wondered how Collection in Magento are built, containing array of individual Entity Objects of Magento? Collections are one of the most important ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/working-with-ajax-in-magento/" rel="bookmark">Working with AJAX in Magento</a></h3><p>Ajax in Magento can be pretty troublesome.Because you will need to take controllers and layout into account.And I almost used up a whole day trying ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/creating-custom-sourced-multiselect-product-attribute/" rel="bookmark">Creating Custom Sourced Multiselect Product Attribute</a></h3><p>Creating Multiselect type of product attribute whose source will be the Magento</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/product-import-in-magento-alongwith-updating-the-attribute%e2%80%99s-options/" rel="bookmark">Product Import In Magento Alongwith Updating The Attribute</a></h3><p>As you may know or not ! Magento is the fastest growing eCommerce plateform, nowonder because Magento has a lots of flexibility in it. You ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/06/magento-creating-ajax-updated-tabs-in-frontend-like-product-management-tabs-of-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tabbed Infowindow in Google Maps</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/04/tabbed-infowindow-in-google-maps/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/04/tabbed-infowindow-in-google-maps/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:50:57 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[latitude]]></category>
		<category><![CDATA[longitude]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=460</guid>
		<description><![CDATA[I wanted to show different categories of information on one GMarker. That is I wanted to show different types of information on a Infowindow for a point on Google Maps. For that I used a tabbed info window, which helped me to show different data on each tabs. Here is the code of what I [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to show different categories of information on one GMarker.  That is I wanted to show different types of information on a Infowindow  for a point on Google Maps. For that I used a tabbed info window, which  helped me to show different data on each tabs. Here is the code of what I  have done. I have shown the latitude and longitude of a placed clicked  on the map on the tabbed info window. This is just the script part. The  demo and download links are given below.</p>
<div id="highlighter_92575">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>&lt;script type=</code><code>"text/javascript"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code> </code><code>var</code> <code>iconBlue = </code><code>new</code> <code>GIcon();</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code> </code><code>iconBlue.image = </code><code>'<a href="http://labs.google.com/ridefinder/images/mm_20_blue.png">http://labs.google.com/ridefinder/images/mm_20_blue.png</a>'</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code> </code><code>iconBlue.shadow = </code><code>'<a href="http://labs.google.com/ridefinder/images/mm_20_shadow.png">http://labs.google.com/ridefinder/images/mm_20_shadow.png</a>'</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code> </code><code>iconBlue.iconSize = </code><code>new</code> <code>GSize(12, 20);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code> </code><code>iconBlue.shadowSize = </code><code>new</code> <code>GSize(22, 20);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code> </code><code>iconBlue.iconAnchor = </code><code>new</code> <code>GPoint(6, 20);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code> </code><code>iconBlue.infoWindowAnchor = </code><code>new</code> <code>GPoint(5, 1);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code> </code><code>var</code> <code>point = </code><code>new</code> <code>GLatLng(26.88157422515243,  86.30859375);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code> </code><code>function</code> <code>load() {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code> </code><code>if</code> <code>(GBrowserIsCompatible())  {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code> </code><code>var</code> <code>map = </code><code>new</code> <code>GMap2(document.getElementById(</code><code>"map"</code><code>));</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code> </code><code>map.setCenter(point,3);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code> </code><code>GEvent.addListener(map, </code><code>'click'</code><code>, </code><code>function</code><code>(overlay,  point) {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code> </code><code>var</code> <code>lati=point.lat();</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code> </code><code>var</code> <code>long=point.lng();</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code> </code><code>var</code> <code>marker= </code><code>new</code> <code>GMarker(</code><code>new</code> <code>GLatLng(lati,  long),{draggable: </code><code>false</code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code> </code><code>map.addOverlay(marker);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code> </code><code>var</code> <code>infoTabs =  [ </code><code>new</code> <code>GInfoWindowTab(</code><code>"Lat-Tab"</code><code>, </code><code>"&lt;h1&gt;  Latitude:&lt;/h1&gt;&lt;br /&gt;"</code><code>+lati), </code><code>new</code> <code>GInfoWindowTab(</code><code>"Long-Tab"</code><code>, </code><code>"&lt;h1&gt;Longitude&lt;/h1&gt;&lt;br  /&gt;"</code><code>+long)];</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code> </code><code>marker.openInfoWindowTabsHtml(infoTabs);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code> </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code> </code><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code> </code><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code> </code><code>&lt;/script&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Lets focus on the <strong>#17-#26</strong> Lines of codes. Other  Lines are already described on other posts. Please see the related post  link below the post.<br />
<strong>#17:</strong> Creates a GMarker on the point where clicked on  the Map.<br />
<strong>#18:</strong> Addes the GMarker over the Map.<br />
<strong>#19:</strong> Initiates an array of tabs<strong>infoTabs </strong> with <strong>GInfoWindowTab </strong> function with <strong>tabname</strong> and its <strong>innerHTML</strong> as parameters.<br />
<strong>#20:</strong> Opens the infowindow calling <strong>openInfoWindowTabsHtml</strong> function and the array of tabs as parameters.</p>
<p><a href="http://subeshexamples.googlecode.com/files/tabinfo.html"><strong>[Download]</strong></a></p>
<div id="seo_alrp_related"><h2>Posts Related to Tabbed Infowindow in Google Maps</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/mapping-the-ip-address-to-latitude-and-longitude-in-google-maps/" rel="bookmark">Mapping The IP Address to Latitude and Longitude In Google Maps</a></h3><p>At last I found hostip.info provides a service for getting the latitude and longitude of a place on the basis of the user</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/google-and-yahoo-seo-tool/" rel="bookmark">google and yahoo seo tool</a></h3><p>An interesting tool that compares the first 100 search results between the two search engines. You can enter a search term and look at the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-dialog-box-tutorial/" rel="bookmark">jQuery Dialog Box Tutorial</a></h3><p>Recently on a coding project for my day job I had a requirement to display a dialog box to confirm that when someone clicked a ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/getting-country-city-name-from-ip-address-in-php-3/" rel="bookmark">Getting country , city name from IP address in PHP</a></h3><p>esterday, miaki asked me how can we get the country name from the IP address in PHP. Today, I’ve come up with the answer of ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/top-floating-message-box-using-jquery-2/" rel="bookmark">Top Floating message box using jQuery</a></h3><p>I’ve shown you how to create a alert box using jQuery. This time, I’ve come up with another tutorial to show you how to display ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/04/tabbed-infowindow-in-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animated content navigation effect using jquery</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/03/animated-content-navigation-effect-using-jquery-2/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/03/animated-content-navigation-effect-using-jquery-2/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 12:00:33 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/2010/03/animated-content-navigation-effect-using-jquery-2/</guid>
		<description><![CDATA[I always get bored with the same stuffs. And, I see same kind of content navigation to the different websites. Click a link, let Posts Related to Animated content navigation effect using jqueryAnimated content navigation effect using jqueryI always get bored with the same stuffs. And, I see same kind of content navigation to the [...]]]></description>
			<content:encoded><![CDATA[<p>I always get bored with the same stuffs. And, I see  same kind of content navigation to the different websites. Click a link,  let</p>
<div id="seo_alrp_related"><h2>Posts Related to Animated content navigation effect using jquery</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/03/animated-content-navigation-effect-using-jquery/" rel="bookmark">Animated content navigation effect using jquery</a></h3><p>I always get bored with the same stuffs. And, I see same kind of content navigation to the different websites. Click a link, let</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/05/what-are-section-categories-and-content-items-in-joomla/" rel="bookmark">What are section, categories and content items in joomla ?</a></h3><p>Joomla! is a content management system. Sections and categories allow you to organize your content. The basic structure is: Sections include Categories. Categories include content ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/how-to-add-beautiful-slide-out-navigation-a-css-and-jquery-tutorial/" rel="bookmark">how to add Beautiful Slide Out Navigation: A CSS and jQuery Tutorial</a></h3><p>1. The HTML Structure The only thing we will need for the navigation is a simple unordered list with links inside of the list elements: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/09/ten-tips-for-improving-the-page-rank-of-your-webpage/" rel="bookmark">Ten tips for improving the page rank of your webpage.</a></h3><p>Writing good content - The most important aspect of getting a higher PR is writing good content for your website, but unfortunately most webmasters ignore ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/07/cloaking/" rel="bookmark">Cloaking</a></h3><p>While we gave SEO service to the website we have to intellect many aspects. In Black SEO Cloaking deals a major part. Cloaking is to ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/03/animated-content-navigation-effect-using-jquery-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery : Benefits, Examples and Free Ebook</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2010/03/jquery-benefits-examples-and-free-ebook-2/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2010/03/jquery-benefits-examples-and-free-ebook-2/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 07:10:05 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[e-book]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=164</guid>
		<description><![CDATA[What is jQuery? Directly taken from the website of jQuery - Posts Related to Jquery : Benefits, Examples and Free EbookjQuery Crash Course Training Delhi/ OnlineDuration: 10 hours To fully understand jQuery and its applications in modern web programming, it's important to take a moment and look back at where ...jQuery Mobile alpha and jQuery [...]]]></description>
			<content:encoded><![CDATA[<h4>What is jQuery?</h4>
<p>Directly taken from the website of jQuery -</p>
<div id="seo_alrp_related"><h2>Posts Related to Jquery : Benefits, Examples and Free Ebook</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/01/jquery-crash-course-training-delhi-online/" rel="bookmark">jQuery Crash Course Training Delhi/ Online</a></h3><p>Duration: 10 hours To fully understand jQuery and its applications in modern web programming, it's important to take a moment and look back at where ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/jquery-mobile-alpha-and-jquery-1-4-3-released/" rel="bookmark">jQuery Mobile alpha and jQuery 1.4.3 released</a></h3><p>There were a couple of releases by the jQuery Team this week! The first alpha release of the jQuery Mobile project was announced a couple ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/latest-jquery-and-jquery-ui-theme-links-on-google-cdn-2/" rel="bookmark">Latest jQuery and jQuery UI Theme links on Google CDN</a></h3><p>I have often seen developers asking where to find the jQuery UI Library and the jQuery UI Themes on Google CDN. Well here’s the list ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/jquery-ui-1-8-9-released/" rel="bookmark">jQuery UI 1.8.9 Released</a></h3><p>If you are using the jQuery UI library in your applications, then an important update is that the jQuery UI team has shipped a maintenance ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/latest-jquery-and-jquery-ui-theme-links-on-google-cdn/" rel="bookmark">Latest jQuery and jQuery UI Theme links on Google CDN</a></h3><p>I have often seen developers asking where to find the jQuery UI Library and the jQuery UI Themes on Google CDN. Well here’s the list ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2010/03/jquery-benefits-examples-and-free-ebook-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

