<?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>Corpocrat Blog &#187; Javascript</title>
	<atom:link href="http://corpocrat.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://corpocrat.com</link>
	<description>Daily Blog from Internet Entrepreneur/Webmaster</description>
	<lastBuildDate>Fri, 30 Jul 2010 11:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick &amp; Easy Form Validation Tutorial with JQuery</title>
		<link>http://corpocrat.com/2009/07/15/quick-easy-form-validation-tutorial-with-jquery/</link>
		<comments>http://corpocrat.com/2009/07/15/quick-easy-form-validation-tutorial-with-jquery/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 08:48:11 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery form validation]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/15/quick-easy-form-validation-tutorial-with-jquery/</guid>
		<description><![CDATA[Quick &#038; Easy Form Validation with JQuery
<p>Form validation has become never been easy like before. If you havent heard of jQuery, then its time to get know now. Jquery is an open source set of javascript library, that brings user interactivity in web applications so easy even for a beginner with just few lines of code.</p>
<p>In this tutorial, i am going to show how easy to validate a form with jquery. For this you will need to download </p>
<p>JQuery Library ...]]></description>
			<content:encoded><![CDATA[<h3>Quick &#038; Easy Form Validation with JQuery</h3>
<p>Form validation has become never been easy like before. If you havent heard of <a href="http://jquery.com">jQuery</a>, then its time to get know now. Jquery is an open source set of javascript library, that brings user interactivity in web applications so easy even for a beginner with just few lines of code.</p>
<p>In this tutorial, i am going to show how easy to validate a form with jquery. For this you will need to download </p>
<p><strong>JQuery Library</strong> &#8211; <a href="http://jquery.com">http://jquery.com</a><br />
<strong>JQuery form validation plugin</strong> &#8211;  <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></p>
<p>Lets say we are going to validate a registration form like shown below..</p>
<p><img src='http://corpocrat.com/wp-content/uploads/2009/07/registerdemo2.PNG' alt='registerdemo2.PNG' /></p>
<h3>Step 1:</h3>
<p>Place the javascript files within the head section </p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.validate.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$(document).ready(function(){
    $(&quot;#registerForm&quot;).validate();
  });
&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>You should set the name and id of your html form same as $(&#8220;#registerForm&#8221;).validate();</p>
<h3>Step 2:</h3>
<p> For each required form element just place <strong>class=&#8221;required&#8221; </strong>and specify <strong>minlength</strong> tag inside it.  For example </p>
<p>Name field -> class=&#8221;required&#8221;<br />
Email field -> class = &#8220;required email&#8221;</p>
<pre class="brush: xml;">
&lt;input name=&quot;name&quot; type=&quot;text&quot; id=&quot;name&quot; class=&quot;required&quot;&gt;
&lt;input name=&quot;user_id&quot; type=&quot;text&quot; id=&quot;user_id&quot; minlength=&quot;4&quot;&gt;
&lt;input name=&quot;user_email&quot; type=&quot;text&quot; id=&quot;user_email&quot; class=&quot;required email&quot;&gt;
</pre>
<p>Thats it! you will be able to validate form field textboxes without any advanced code.<br />
For optional fields, you can specify class=&#8221;optional&#8221; or just leave it.</p>
<h3>Step 3 </h3>
<p>In this last step you will add some styles to the error messages in the stylesheet. </p>
<pre class="brush: xml;">
.error {
	font: normal 10px arial;
	padding: 3px;
	margin: 3px;
	background-color: #ffc;
	border: 1px solid #c00;
}
</pre>
<p>Thats it! see how the validation works like a charm..</p>
<p><img src='http://corpocrat.com/wp-content/uploads/2009/07/registererror.PNG' alt='registererror.PNG' /></p>
<h3>Advanced Validation </h3>
<p>The following are some of bit advanced validation code that might help you.</p>
<p><strong>To check password and password retype are same </strong></p>
<pre class="brush: jscript;">
   &lt;tr&gt;
      &lt;td&gt;Password&lt;/td&gt;
      &lt;td&gt;&lt;input name=&quot;pwd&quot; type=&quot;text&quot; id=&quot;pwd&quot; class=&quot;required&quot; minlength=&quot;5&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Retype Password&lt;/td&gt;
      &lt;td&gt;&lt;input name=&quot;pwdc&quot; type=&quot;text&quot; id=&quot;pwdc&quot; class=&quot;required&quot; equalTo=&quot;#pwd&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
</pre>
<p><strong>To validate a website URL &#8211; optional field</strong><br />
It should check the URL and force the user to enter full url with http. </p>
<pre class="brush: jscript;">
 &lt;tr&gt;
            &lt;td&gt;Website &lt;/td&gt;
            &lt;td&gt;&lt;input name=&quot;web&quot; type=&quot;text&quot; id=&quot;web2&quot; class=&quot;optional defaultInvalid url&quot;&gt;
              &lt;span class=&quot;example&quot;&gt;http://www.example.com&lt;/span&gt;&lt;/td&gt;

          &lt;/tr&gt;
</pre>
<p><strong>To validate Phone Number</strong></p>
<p>We dont want restrict phone numbers to be US only. Suppose if a foreign person enters a phone with + and dashes, we want that as well. To do this you will need to  make slight change inside document.ready() in head section.</p>
<pre class="brush: jscript;">
&lt;script&gt;
  $(document).ready(function(){
    $.validator.addMethod(&quot;NumbersOnly&quot;, function(value, element) {
        return this.optional(element) || /^[0-9\-\+]+$/i.test(value);
    }, &quot;Phone must contain only numbers, + and -.&quot;);

    $(&quot;#regForm&quot;).validate();
  });
  &lt;/script&gt;
</pre>
<p>and now you can validate specifying <strong>class=&#8221;required NumbersOnly&#8221;</strong>. This will allow only numbers  0-9, hyphen and + for country code.</p>
<pre class="brush: xml;">
    &lt;tr&gt;
      &lt;td&gt;Phone&lt;/td&gt;
      &lt;td&gt;&lt;input name=&quot;phone&quot; type=&quot;text&quot; id=&quot;phone&quot; class=&quot;required NumbersOnly&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
</pre>
<p><strong>Validating Username with no special characters</strong></p>
<p>We dont want username to contain any special characters like dot,slashes etc. We only want to allow alphabets, numbers and underscore.</p>
<p>We create a function similar way like above</p>
<pre class="brush: jscript;">
&lt;script&gt;
  $(document).ready(function(){
    $.validator.addMethod(&quot;username&quot;, function(value, element) {
        return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
    }, &quot;Username must contain only letters, numbers, or underscore.&quot;);

    $(&quot;#regForm&quot;).validate();
  });
  &lt;/script&gt;
</pre>
<p>and now you can call using <strong>class=&#8221;required username&#8221;</strong></p>
<pre class="brush: xml;">
&lt;tr&gt;
&lt;td&gt;User ID&lt;/td&gt;
&lt;td&gt;
&lt;input name=&quot;user_name&quot; type=&quot;text&quot; id=&quot;user_name&quot; class=&quot;required username&quot; minlength=&quot;4&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Enjoy jQuery! </p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/15/quick-easy-form-validation-tutorial-with-jquery/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>how to strip special characters with jQuery form validation!</title>
		<link>http://corpocrat.com/2009/07/13/jquery-form-validation-stripping-special-characters/</link>
		<comments>http://corpocrat.com/2009/07/13/jquery-form-validation-stripping-special-characters/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 08:12:39 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery strip characters]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/13/jquery-form-validation-stripping-special-characters/</guid>
		<description><![CDATA[JQuery form validation &#8211; How to remove special characters! 
<p>i was using a jquery form validation plugin and it was so easy in validating a form. I was stuck in a scenario where i want users to register userID and i dont want them to enter special characters like dots and just want them to enter alphabets, number and underscore in the username.</p>
<p>I went through the documentation of the plugin and there was no such methods to strip the special ...]]></description>
			<content:encoded><![CDATA[<h3>JQuery form validation &#8211; How to remove special characters! </h3>
<p>i was using a <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jquery form validation plugin</a> and it was so easy in validating a form. I was stuck in a scenario where i want users to register userID and i dont want them to enter special characters like dots and just want them to enter alphabets, number and underscore in the username.</p>
<p>I went through the documentation of the plugin and there was no such methods to strip the special characters in the plugin.</p>
<p>Finally, i somehow got hold of the code that does the job through regular expression regex that checks for only numbers and a-z </p>
<pre class="brush: jscript;">
  &lt;script&gt;
  $(document).ready(function(){

      $.validator.addMethod(&quot;noSpecialChars&quot;, function(value, element) {
        return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
    }, &quot;Username must contain only letters, numbers, or underscore.&quot;);

    $(&quot;#myForm&quot;).validate();
  });
  &lt;/script&gt;
</pre>
<p>All you have to do is call this function from the textbox element. Dont forget to check out the example of <a href="http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage">addMethod()</a></p>
<pre class="brush: jscript;">
//call this from html code within class=required
&lt;input id=&quot;cname&quot; name=&quot;name&quot; size=&quot;25&quot; class=&quot;required noSpecialChars&quot; minlength=&quot;2&quot; /&gt;
</pre>
<p>Works like a charm!</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/13/jquery-form-validation-stripping-special-characters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>how to reload/refresh a page with jquery?</title>
		<link>http://corpocrat.com/2009/07/12/how-to-reloadrefresh-a-page-with-jquery/</link>
		<comments>http://corpocrat.com/2009/07/12/how-to-reloadrefresh-a-page-with-jquery/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 15:00:19 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery reload page]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/12/how-to-reloadrefresh-a-page-with-jquery/</guid>
		<description><![CDATA[how to reload/refresh a page with jquery?
<p>Its very simple.</p>
<p>Lets say you have a button refresh all, which basically does reloading the page when you click it. Here is the code</p>

// use location.reload() in jquery to reload a page within onclick
&#60;input name=&#34;doRefresh&#34; type=&#34;button&#34; id=&#34;doRefresh&#34;
value=&#34;Refresh All&#34; onClick=&#34;location.reload();&#34;&#62;

]]></description>
			<content:encoded><![CDATA[<h3>how to reload/refresh a page with jquery?</h3>
<p>Its very simple.</p>
<p>Lets say you have a button refresh all, which basically does reloading the page when you click it. Here is the code</p>
<pre class="brush: jscript;">
// use location.reload() in jquery to reload a page within onclick
&lt;input name=&quot;doRefresh&quot; type=&quot;button&quot; id=&quot;doRefresh&quot;
value=&quot;Refresh All&quot; onClick=&quot;location.reload();&quot;&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/12/how-to-reloadrefresh-a-page-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix-&gt; JQuery onclick browser jumps to top of page!</title>
		<link>http://corpocrat.com/2009/07/12/fix-jquery-onclick-browser-jumps-to-top-of-page/</link>
		<comments>http://corpocrat.com/2009/07/12/fix-jquery-onclick-browser-jumps-to-top-of-page/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 14:27:35 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery onclick]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/12/fix-jquery-onclick-browser-jumps-to-top-of-page/</guid>
		<description><![CDATA[JQuery onclick jumps to top of page
<p>i had an issue with jquery code where i have a html link doing specific tasks for onclick event. Since the appear on bottom of my page, when i click on the link the browser jumps to top of the page every time i click.</p>

&#60;a href=&#34;#&#34; onclick=&#34;dofunct()&#34;&#62;click me&#60;/a&#62;

<p>This is really very frustrating as everytime i click a link, the browser jumps to top of page. After a long search, i fixed the problem by ...]]></description>
			<content:encoded><![CDATA[<h3>JQuery onclick jumps to top of page</h3>
<p>i had an issue with jquery code where i have a html link doing specific tasks for onclick event. Since the appear on bottom of my page, when i click on the link the browser jumps to top of the page every time i click.</p>
<pre class="brush: jscript;">
&lt;a href=&quot;#&quot; onclick=&quot;dofunct()&quot;&gt;click me&lt;/a&gt;
</pre>
<p>This is really very frustrating as everytime i click a link, the browser jumps to top of page. After a long search, i fixed the problem by replacing # with javascript void function.</p>
<pre class="brush: jscript;">
&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;dofunc()&quot;&gt;click me&lt;/a&gt;
</pre>
<p>It neatly solved my jump problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/12/fix-jquery-onclick-browser-jumps-to-top-of-page/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>how to call a php script from javascript?</title>
		<link>http://corpocrat.com/2009/07/12/how-to-call-a-php-script-from-javascript/</link>
		<comments>http://corpocrat.com/2009/07/12/how-to-call-a-php-script-from-javascript/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 05:28:36 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[call php from javascript]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/12/how-to-call-a-php-script-from-javascript/</guid>
		<description><![CDATA[how to call a php script from javascript?
<p>I have always wondered how to call a php script and send GET data from javascript code. It was very important for me as in many projects i have worked i never wanted to header redirect to original php page after delete, edit operations which is really a mess.</p>
<p>jQuery has revolutionized the way we look at javascript and it has certainly bridged the javascript(client side) and php (server side). </p>
<p>so how do you ...]]></description>
			<content:encoded><![CDATA[<h3>how to call a php script from javascript?</h3>
<p>I have always wondered how to call a php script and send GET data from javascript code. It was very important for me as in many projects i have worked i never wanted to header redirect to original php page after delete, edit operations which is really a mess.</p>
<p><a href="http://jquery.com/">jQuery </a>has revolutionized the way we look at javascript and it has certainly bridged the javascript(client side) and php (server side). </p>
<p><strong>so how do you call a php script from javascript?</strong></p>
<p>i am going to show how with just one line of javascript code, you can send GET data to php script and get the output from php script show in javascript inside span or div.</p>
<p>A simple example would be a form registration checking for user availability.</p>
<p><img src='http://corpocrat.com/wp-content/uploads/2009/07/demo.PNG' alt='demo.PNG' /></p>
<p>Logic is simple.you call a php script upon clicking check availability and javascript onClick event fires and the php script returns the data with &#8220;available&#8221; or &#8220;not available&#8221;.  i have used <strong><a href="http://jquery.com/">jquery</a></strong> here.</p>
<p>Take a look at onclick event. </p>
<pre class="brush: xml;">
&lt;td&gt;&lt;input name=&quot;user_name&quot; type=&quot;text&quot; id=&quot;user_name&quot; class=&quot;required&quot;&gt;
              &lt;input name=&quot;btnAvailable&quot; type=&quot;submit&quot; id=&quot;btnAvailable&quot;
			  onclick='$.get(&quot;checkuser.php&quot;,{ cmd: &quot;check&quot;, user: $(&quot;#user_name&quot;).val() } ,function(data){ $(&quot;#checkid&quot;).html(data); });'
			  value=&quot;Check Availability&quot;&gt; &lt;span style=&quot;color:red; font: bold 12px verdana; &quot; id=&quot;checkid&quot; &gt;&lt;/span&gt;
            &lt;/td&gt;
</pre>
<p>This single line of code sends GET data to <strong>check.php?cmd=check&#038;user=demo</strong>. Isnt that wonderful? Havnt we bridged php and javascript.</p>
<p>Here is some explanation.</p>
<pre class="brush: jscript;">
checkuser.php -&gt; name of php script to call
cmd,user -&gt; GET parameters
$(&quot;#user_name&quot;).val() -&gt; Gets text box value with id user_name;
$(&quot;#checkid&quot;).html(data); -&gt; Shows the output of php script within a span
</pre>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/12/how-to-call-a-php-script-from-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to check if image loaded or not in javascript?</title>
		<link>http://corpocrat.com/2009/07/02/how-to-check-if-image-loaded-or-not-in-javascript/</link>
		<comments>http://corpocrat.com/2009/07/02/how-to-check-if-image-loaded-or-not-in-javascript/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 08:44:44 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript image reloaded]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/02/how-to-check-if-image-loaded-or-not-in-javascript/</guid>
		<description><![CDATA[how to check if image loaded or not in javascript?
<p>If you are having a webpage with large sized images, you would notice the browser taking long time to load those images and showup. A good idea would be show a loading animation until large photos load.</p>
<p>There is a way to check whether the images have been loaded or not in javascript. Using the Image() object is a good method to cache large images.</p>
<p>You can use onload function to trigger a ...]]></description>
			<content:encoded><![CDATA[<h3>how to check if image loaded or not in javascript?</h3>
<p>If you are having a webpage with large sized images, you would notice the browser taking long time to load those images and showup. A good idea would be show a loading animation until large photos load.</p>
<p>There is a way to check whether the images have been loaded or not in javascript. Using the <strong>Image() </strong>object is a good method to cache large images.</p>
<p>You can use <strong>onload</strong> function to trigger a event after loading is complete.</p>
<pre class="brush: jscript;">
objImg = new Image();
objImg.src = 'photo.gif';
objImg.onload = function() {
                           /// do some work;
                        }
</pre>
<p>Another way of checking is use complete property</p>
<pre class="brush: jscript;">
objImg = new Image();
objImg.src = 'photo.gif';

if(!objImg.complete)
 {
        /// do other work;
             }
</pre>
<p>Hope this helps if you are a javascript programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/02/how-to-check-if-image-loaded-or-not-in-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>how to change div content in javascript?</title>
		<link>http://corpocrat.com/2009/07/02/how-to-change-div-content-in-javascript/</link>
		<comments>http://corpocrat.com/2009/07/02/how-to-change-div-content-in-javascript/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 08:35:14 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript div content]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/07/02/how-to-change-div-content-in-javascript/</guid>
		<description><![CDATA[how to change div content in javascript?
<p>Its very easy to change the contents of div in javascript. Just get the object of div  using getElemementbyID() or getElementbyName() and use innerHTML property with the new value.</p>

divObj = document. getElementbyID(&#34;mydiv&#34;);
divObj.innerHTML = '&#60;p&#62;This is a html code&#60;/p&#62;';

<p>One important thing to note is, your div should have loaded after all the images. If not it wont work.</p>
]]></description>
			<content:encoded><![CDATA[<h3>how to change div content in javascript?</h3>
<p>Its very easy to change the contents of div in javascript. Just get the object of div  using getElemementbyID() or getElementbyName() and use <strong>innerHTML</strong> property with the new value.</p>
<pre class="brush: jscript;">
divObj = document. getElementbyID(&quot;mydiv&quot;);
divObj.innerHTML = '&lt;p&gt;This is a html code&lt;/p&gt;';
</pre>
<p>One important thing to note is, your div should have loaded after all the images. If not it wont work.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/07/02/how-to-change-div-content-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Best Web based WYSIWYG html editors (Free)</title>
		<link>http://corpocrat.com/2009/02/18/top-best-web-based-wysiwyg-html-editors-free/</link>
		<comments>http://corpocrat.com/2009/02/18/top-best-web-based-wysiwyg-html-editors-free/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 07:58:15 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP Scripts]]></category>
		<category><![CDATA[wysiwyg html editors]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2009/02/18/top-best-web-based-wysiwyg-html-editors-free/</guid>
		<description><![CDATA[Best WYSIWYG HTML Editors
<p>I have been searching for some of best web based html editors written in javascript so that i can integrate it with my scripts. I have found pretty nice open source wysiwyg editors so i decided to blog it here. </p>
<p>Please note that some of the editors are just markup editors, which i believe a pretty good alternative to web applications needing lightweight editor. I very much prefer using markup editors keeping simple with just textarea than ...]]></description>
			<content:encoded><![CDATA[<h3>Best WYSIWYG HTML Editors</h3>
<p>I have been searching for some of best web based html editors written in javascript so that i can integrate it with my scripts. I have found pretty nice open source wysiwyg editors so i decided to blog it here. </p>
<p>Please note that some of the editors are just markup editors, which i believe a pretty good alternative to web applications needing lightweight editor. I very much prefer using markup editors keeping simple with just textarea than providing rich text environment because wysiwyg tend use iframes which are subjected to more vulnerabilities.</p>
<h3>TinyMCE</h3>
<p>Web based Javascript HTML WYSIWYG editor.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/tinymce.PNG' alt='tinymce.PNG' /><br />
License: Free (LGPL)</p>
<p><a href="http://tinymce.moxiecode.com">Homepage</a> | <a href="http://tinymce.moxiecode.com/download.php">Download</a></p>
<h3>NicEdit</h3>
<p>A fast loading WYSIWYG html editor for use in your web applications.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/nicedit.PNG' alt='nicedit.PNG' /><br />
License: Free (MIT license)<br />
<a href="http://nicedit.com">Homepage</a> | <a href="http://nicedit.com/download.php">Download</a></p>
<h3>OpenWebWare</h3>
<p>Powerful WYSIWYG html editor supports many cross browser platforms and it works replacing all textareas to html editor.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/openwebware.PNG' alt='openwebware.PNG' /><br />
License: Free (GNU Lesser License)<br />
<a href="http://www.openwebware.com/">Homepage </a>| <a href="http://www.openwebware.com/download.shtml">Download</a></p>
<h3>widgEditor</h3>
<p>It is a simple, easy to customize WYSIWYG editor for textarea replacement.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/widgeditor.PNG' alt='widgeditor.PNG' /><br />
License: Free (GNU GPL)<br />
<a href="http://www.themaninblue.com/experiment/widgEditor/">Homepage | Download</a></p>
<h3>Textarea HTML Markup Editor</h3>
<p>It is the lightweight and very fast loading editor, which just inserts html markup codes on the selected text. It is not WYSIWYG editor.<br />
<img src="http://corpocrat.com/wp-content/uploads/2008/12/taeditor-demo.PNG" alt="markup" /><br />
License: Free<br />
<a href="http://corpocrat.com/2008/12/18/free-wysiwyg-textarea-html-editor/">Homepage | Download  </a></p>
<h3>WyZZ </h3>
<p>An small, light-weight html editor written in javascript. It is free for download.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/wyzz.PNG' alt='wyzz.PNG' /><br />
License: Free (LGPL)<br />
<a href="http://www.wyzz.info">Homepage</a> | <a href="http://www.wyzz.info/downloads_page.html">Download</a></p>
<h3>markItUp!</h3>
<p>Universal markup editor (not WYSIWYG) which can insert html, bbcode, textile, wiki syntax and many more markups. It is written with <a href="http://jquery.com/">jQuery library</a><br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/markitup.PNG' alt='markitup.PNG' /><br />
Licence: Free under MIT/GPL<br />
<a href="http://markitup.jaysalvat.com/home/">Homepage</a> | <a href="http://markitup.jaysalvat.com/downloads/">Download</a></p>
<h3>Kevin Roth RTE (Rich Text Editor)</h3>
<p>A cross browser rich text editor works in mozilla, IE, safari, opera and many browsers.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/rte.PNG' alt='rte.PNG' /><br />
License: Free (Creative commons)<br />
<a href="http://www.kevinroth.com/rte/">Homepage</a> | <a href="http://www.kevinroth.com/rte/">Download</a></p>
<h3>Hypertextarea</h3>
<p>Free WYSIWYG html editor with rich text environment. It works on any platform.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/hypertextarea.PNG' alt='hypertextarea.PNG' /><br />
License: Free<br />
<a href="http://hypertextarea.sourceforge.net/">Homepage</a> | <a href="http://sourceforge.net/project/showfiles.php?group_id=100271">Download</a></p>
<h3>SPAW Editor</h3>
<p><img src='http://corpocrat.com/wp-content/uploads/2009/02/spaw.PNG' alt='spaw.PNG' /><br />
License: Free (GNU GPL)<br />
<a href="http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_intro">Homepage | Download</a></p>
<h3>WYMeditor</h3>
<p>Web based xhtml editor works best and can be easily integrated to content management system applications.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/wymeditor.PNG' alt='wymeditor.PNG' /><br />
License: Free (GPL/MIT)<br />
<a href="http://www.wymeditor.org/">Homepage </a>| <a href="http://www.wymeditor.org/download/">Download</a></p>
<h3>Whizzywig</h3>
<p>Free web based rich text editor for your projects.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/whizzy.PNG' alt='whizzy.PNG' /><br />
License: Free<br />
<a href="http://unverse.net/whizzywig-cross-browser-html-editor.html">Homepage</a> | <a href="http://www.unverse.net/whizzywig-download.html">Download</a></p>
<h3>ST Editor</h3>
<p>Simple wysiwyg editor and light weight editor.<br />
<img src='http://corpocrat.com/wp-content/uploads/2009/02/steditor.PNG' alt='steditor.PNG' /><br />
License: Free (BSD Revised)<br />
<a href="http://www.gosu.pl/STEditor/">Homepage</a> | <a href="http://www.gosu.pl/STEditor/">Download</a></p>
<p>For a comprehensive list of wysiwyg editors, you can refer to <a href="http://www.geniisoft.com/showcase.nsf/WebEditors">Genii Web Editors list</a></p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2009/02/18/top-best-web-based-wysiwyg-html-editors-free/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix -&gt; Caret/Cursor jumps to start of textarea in javascript</title>
		<link>http://corpocrat.com/2008/12/24/fix-caretcursor-jumps-to-top-of-textarea-in-javascript/</link>
		<comments>http://corpocrat.com/2008/12/24/fix-caretcursor-jumps-to-top-of-textarea-in-javascript/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 09:13:41 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript cursor problem]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2008/12/24/fix-caretcursor-jumps-to-top-of-textarea-in-javascript/</guid>
		<description><![CDATA[<p>I was working on a javascript bbcode editor (textarea based) and often if the textarea contents are long and automatic scrollbars are enabled. If i replace selected code in textarea using javascript often the cursor jumps to start of the textarea and focus is lost. This problem only happens in firefox and works fine in IE.</p>
<p>This is a very annoying problem and everytime you have to scroll down to insert changes to your textarea content. </p>
<p>Here is you fix it.</p>
<p>Store ...]]></description>
			<content:encoded><![CDATA[<p>I was working on a javascript <a href="http://corpocrat.com/2008/08/15/free-wysiwyg-bbcode-editor-in-javascript/">bbcode editor</a> (textarea based) and often if the textarea contents are long and automatic scrollbars are enabled. If i replace selected code in textarea using javascript often the cursor jumps to start of the textarea and focus is lost. This problem only happens in firefox and works fine in IE.</p>
<p>This is a very annoying problem and everytime you have to scroll down to insert changes to your textarea content. </p>
<p>Here is you fix it.</p>
<p>Store the scroll position in a variable and you replace selected text, bring back the scroll to the original position. This 3 lines of code will solve the problem for firefox.</p>
<pre class="brush: jscript;">var scrollTop = textarea.scrollTop;
var scrollLeft = textarea.scrollLeft;

objTextarea.scrollTop = scrollTop;
objTextarea.scrollLeft = scrollLeft;
</pre>
<p>I struggled a lot get this fix for simplest of problems and it was less documented on the web.<br />
Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2008/12/24/fix-caretcursor-jumps-to-top-of-textarea-in-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free Markup TextArea HTML Editor in Javascript</title>
		<link>http://corpocrat.com/2008/12/18/free-wysiwyg-textarea-html-editor/</link>
		<comments>http://corpocrat.com/2008/12/18/free-wysiwyg-textarea-html-editor/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 20:41:55 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[free javascript html markup editor]]></category>

		<guid isPermaLink="false">http://corpocrat.com/2008/12/18/free-wysiwyg-textarea-html-editor/</guid>
		<description><![CDATA[<p>A dead simple, fast loading, light weight and easy to use html markup editor for your projects. It is the ultimate textarea replacement. It does not use iframes instead it just replaces textarea  into an editor where you can insert basic html markup codes like bold, italic, hyperlink, image, blockquote and more..</p>
<p>Much of the inspiration of this editor came from the editor used in wordpress forums. I really loved the simplicity of the editor used there. The reason i ...]]></description>
			<content:encoded><![CDATA[<p>A dead simple, fast loading, light weight and easy to use <strong>html markup editor</strong> for your projects. It is the ultimate textarea replacement. It does not use iframes instead it just replaces textarea  into an editor where you can insert basic html markup codes like bold, italic, hyperlink, image, blockquote and more..</p>
<p>Much of the inspiration of this editor came from the editor used in <a href="http://wordpress.org/support/forum/5">wordpress forums</a>. I really loved the simplicity of the editor used there. The reason i kept as textarea editor instead of using iframes (which gives rich html) is because iframe based editors are subjected too many injection attacks.</p>
<p><strong>Features</strong></p>
<p>- Inserts HTML codes in textarea<br />
- No iFrames<br />
- Fast loading and lightweight (code just under 2kb)<br />
- Works on all major browsers<br />
- No popup html window for inserting hyperlinks.<br />
- Easy to integrate<br />
- Inserts quick html code<br />
- Inserts ordered and unordered lists (new feature)</p>
<p><img src="http://corpocrat.com/wp-content/uploads/2008/12/taeditor-demo.PNG" alt="taeditor-demo.PNG" /></p>
<p><strong><a href="http://php-login-script.com/taeditor/demo.htm">Demo<br />
</a></strong><br />
<strong><a title="taeditor_v1_2.zip" href="http://corpocrat.com/wp-content/uploads/2009/08/taeditor_v1_4.zip">Download (5kb)</a></strong></p>
<p>This editor is <strong>100% FREE</strong> and feel free to use this editor in your projects or do whatever you want. <strong>Please spread word by any means possible.</strong></p>
<p><strong>Note:</strong>This editor inserts html code. If you want a same editor, capable of inserting bbcode, you can <a href="http://corpocrat.com/2008/08/15/free-wysiwyg-bbcode-editor-in-javascript/">download free bbcode editor</a></p>
<h4>Free Icons</h4>
<p>If you want to customize the editor with new icons you can <a href="http://www.famfamfam.com/lab/icons/silk/">download silk icons set</a>. It is free!</p>
<h3>How to Install</h3>
<p>1. Just extract the folder and upload editor folder to your server. All the editor code and images are inside that folder. You should not run any php scripts inside this folder. Any html or php script calling this editor must above and outside this folder</p>
<p>2. Create a PHP script or html page (ex: example.php ) and initialize the editor with the below code.</p>
<h3>Starting the Editor</h3>
<p>To initialize the editor, you have insert the following lines</p>
<p>1. Place this code inside the  of the html page inside head tag.</p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; src=&quot;editor/ed.js&quot;&gt;&lt;/script&gt;
</pre>
<p>2. Place this 2 lines of code within the form or wherever you want the textarea editor to appear. The name and id of textarea could be anything, just make sure that both are same.</p>
<pre class="brush: xml;">
....
&lt;script&gt;edToolbar('mytxtarea'); &lt;/script&gt;
&lt;textarea name=&quot;mytxtarea&quot; id=&quot;mytxtarea&quot; class=&quot;ed&quot;&gt;&lt;/textarea&gt;

.....
</pre>
<p><strong>Note: </strong>Make sure that the <strong>id </strong> value and the value inside of  <strong>edToolbar ()</strong> is same.</p>
<p>If you want multiple instances of editors, on same page</p>
<pre class="brush: xml;">
&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
  &lt;p&gt;
    &lt;script&gt;edToolbar('mytxtarea'); &lt;/script&gt;
    &lt;textarea name=&quot;mytxtarea&quot; id=&quot;mytxtarea&quot; class=&quot;ed&quot;&gt;This is a sample text&lt;/textarea&gt;
  &lt;/p&gt;
    &lt;p&gt;
    &lt;script&gt;edToolbar('mytxtarea2'); &lt;/script&gt;
    &lt;textarea name=&quot;mytxtarea2&quot; id=&quot;mytxtarea2&quot; class=&quot;ed&quot;&gt;This is a sample text&lt;/textarea&gt;
  &lt;/p&gt;
    &lt;p&gt;
    &lt;script&gt;edToolbar('mytxtarea3'); &lt;/script&gt;
    &lt;textarea name=&quot;mytxtarea3&quot; id=&quot;mytxtarea3&quot; class=&quot;ed&quot;&gt;This is a sample text&lt;/textarea&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;
  &lt;/p&gt;
&lt;/form&gt;
</pre>
<p>The default height and width of text area is specified in styles.css. It is 400px width and 150 height. You can open styles.css and modify the width and height of text area.</p>
<h3>Frequently Asked Questions</h3>
<p><strong>1. How do i customize the editor with stylesheet?</strong></p>
<p>It is easy to customize the images and editor with stylesheet. Just change stylesheet code in <strong>styles.css </strong></p>
<p><strong>2. Images does not appear or does not load.</strong></p>
<p>There could be a problem in the path of images the editor relative to your PHP script. Just place the bbeditor folder below / assuming that php script is in /example.php and the editor is /bbeditor/images</p>
<p>if you want to manually change the path of images, open ed.js and you will need to change lines like this indicating the correct path of images.</p>
<pre class="brush: jscript;">
document.write(&quot;&lt;img class=\&quot;button\&quot; src=\&quot;editor/images/bold.gif\&quot; name=\&quot;btnBold\&quot; onClick=\&quot;doAddTags('&lt;strong&gt;','&lt;/strong&gt;')\&quot;&gt;&quot;);
.....
</pre>
<p><strong>3. How do i load the data stored in database to the editor for editing?</strong></p>
<p>This is a very important question. Suppose you have inserted the content with bbcodes to the database but what if you want to make changes to the content. You might want to pull the content from database and load it in editor to make editing and changes to it. In that case you will need to output the javascript initialization with php. In this way you will load the content when the editor starts.</p>
<pre class="brush: xml;">
&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
  &lt;p&gt;
&lt;script&gt;edToolbar('mytxtarea'); &lt;/script&gt;
&lt;textarea name=&quot;mytxtarea&quot; id=&quot;mytxtarea&quot; class=&quot;ed&quot;&gt;//PHP CODE HERE//&lt;/textarea&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;
  &lt;/p&gt;
&lt;/form&gt;
</pre>
<p>Disclaimer: use of this script is at your own risk.</p>
<p>You can also discuss about this script in my <strong><a href="http://webmasterpals.com">forum</a></strong>. Although i cannot provide support because of my busy schedule, i would be happy to discuss in the forum.</p>
<p><a href="http://www.scripts.com"><img src="http://images.devshed.com/scr/banners/banner_160x40.gif" border="0" alt="Scripts.com" /></a></p>
<p>Enjoy the editor!</p>
<p><em>Our <a href="http://www.testking.com/650-621.htm">650-621</a> practice questions are more then simple <a href="http://www.testking.com/70-236.htm">70-236</a> test prepared to help you assess your real knowledge for <a href="http://www.testking.com/70-270.htm">70-270</a> exam.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2008/12/18/free-wysiwyg-textarea-html-editor/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
	</channel>
</rss>
