	<?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>Mahdi Pedramrazi</title>
	<atom:link href="http://mahdipedram.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mahdipedram.com</link>
	<description>Front-end , back-end Programming , Focusing on jQuery and PHP</description>
	<lastBuildDate>Sun, 28 Apr 2013 07:37:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Mistakes On Chain Assignment In javascript</title>
		<link>http://mahdipedram.com/mistakes-on-chain-assignment-in-javascript/</link>
		<comments>http://mahdipedram.com/mistakes-on-chain-assignment-in-javascript/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 20:02:24 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/mistakes-on-chain-assignment-in-javascript/</guid>
		<description><![CDATA[One common mistake that I see developers do is exposing a variable to the Global object in chain assignment. first I let's see how can you expose a variable to the Global object by accident. &#160; function test&#40;&#41;&#123; a =12; // var is missing return a; &#125; test&#40;&#41;; &#160; By missing the keyword var even(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fmistakes-on-chain-assignment-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fmistakes-on-chain-assignment-in-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>One common mistake that I see developers do is exposing a variable to the Global object in chain assignment.</p>
<p>first I let's see how can you expose a variable to the Global object by accident.</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
a =<span style="color: #CC0000;">12</span>; <span style="color: #009900; font-style: italic;">// var is missing</span>
<span style="color: #000066; font-weight: bold;">return</span> a;
<span style="color: #66cc66;">&#125;</span>
test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>By missing the keyword var even though variable a is inside of the function but "a" will be exposed to the global object(Window Object).</p>
<p>now you would say I already know this and I will not miss the var keyword.</p>
<p>this is a common mistake that I've see programmers do and I've done it in the past.<br />
javascript is not PHP or any other scripting language.</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x = y = <span style="color: #CC0000;">2</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Now in this case "x" is local variable, but "y" become a global variable.<br />
this is because of right-to-left evaluation so when y = 2 there is no var to be set for it so it become a global variable.</p>
<p>to prevent of having such a design flaw. use var all the time.<br />
the correct version would look like</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x,y;
  x = y = <span style="color: #CC0000;">2</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/mistakes-on-chain-assignment-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Namespace in jQuery</title>
		<link>http://mahdipedram.com/namespace-in-jquery/</link>
		<comments>http://mahdipedram.com/namespace-in-jquery/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 21:15:54 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/namespace-in-jquery/</guid>
		<description><![CDATA[I have implemented a jQuery plugin that will take care of namespacing for us. if you don't know what is namespace please read it from here take a look at the code below. and see how it works. you can get the code from jsfiddle as well $.namespace&#40;&#34;liteframe.actions.controller&#34;&#41;; //OR this way. $.namespace&#40;&#91;&#34;liteframe.actions.controller&#34;,&#34;cake.action.jump&#34;&#93;&#41;; //OR this way.(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fnamespace-in-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fnamespace-in-jquery%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have implemented a jQuery plugin that will take care of namespacing for us.<br />
if you don't know what is namespace please read it from <a href="http://en.wikipedia.org/wiki/Namespace_%28computer_science%29" target="_self">here</a></p>
<p>take a look at the code below. and see how it works. you can get the code from jsfiddle as well</p>
<pre class="javascript">     $.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;liteframe.actions.controller&quot;</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #009900; font-style: italic;">//OR this way.</span>
     $.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">&quot;liteframe.actions.controller&quot;</span>,<span style="color: #3366CC;">&quot;cake.action.jump&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #009900; font-style: italic;">//OR this way.</span>
     $.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;liteframe.actions.controller&quot;</span>,<span style="color: #3366CC;">&quot;cake.action.jump&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
   <span style="color: #009900; font-style: italic;">// now they are available to the us. </span>
&nbsp;
  liteframe.<span style="color: #006600;">actions</span>.<span style="color: #006600;">controller</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #009900; font-style: italic;">// some code here</span>
  <span style="color: #66cc66;">&#125;</span>;
&nbsp;
  cake.<span style="color: #006600;">action</span>.<span style="color: #006600;">jump</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #009900; font-style: italic;">// some code here</span>
  <span style="color: #66cc66;">&#125;</span>;</pre>
<p><iframe style="width: 100%; height: 900px" src="http://jsfiddle.net/Bcwr5/1/embedded/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/namespace-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing elements from an array in javascript</title>
		<link>http://mahdipedram.com/removing-elements-from-an-array-in-javascript/</link>
		<comments>http://mahdipedram.com/removing-elements-from-an-array-in-javascript/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:46:47 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javscript]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/removing-elements-from-an-array-in-javascript/</guid>
		<description><![CDATA[If you are trying to remove elements from an array. and do not care what those elements are, you shouldn't use array slice, array splice. however there is an easier way of doing this. by just changin the length of an array we can modify our array and remove items from it. &#160; var arr(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fremoving-elements-from-an-array-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fremoving-elements-from-an-array-in-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are trying to remove elements from an array. and do not care what those elements are, you shouldn't use array slice, array splice.<br />
however there is an easier way of doing this.</p>
<p>by just changin the length of an array we can modify our array and remove items from it.</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span>,<span style="color: #CC0000;">3</span>,<span style="color: #CC0000;">4</span>,<span style="color: #CC0000;">5</span><span style="color: #66cc66;">&#93;</span>;
arr.<span style="color: #006600;">length</span> = <span style="color: #CC0000;">2</span>;
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span> arr <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">//[1,2]; // we removed 3 items from our array.</span>
&nbsp;</pre>
<p>let's now wrap it in a function<br />
as you can see arrays are objects and objects are passed by reference.</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popItems<span style="color: #66cc66;">&#40;</span>arr, length<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">return</span> arr.<span style="color: #006600;">length</span> -= length;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span>,<span style="color: #CC0000;">3</span>,<span style="color: #CC0000;">4</span>,<span style="color: #CC0000;">5</span><span style="color: #66cc66;">&#93;</span>;
popItems<span style="color: #66cc66;">&#40;</span>arr, <span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>; 
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>arr <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// [1,2,3]</span>
&nbsp;</pre>
<p>it is recommended to have all your functionalists encapsulated into objects so programmers could use them over and over.<br />
so performance and speed are vital. I personally will use arr.length. </p>
<p>now one would say I still prefer to use array slice or spice or even using it for loop.</p>
<p><strong>Array Slice Version</strong></p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popItems<span style="color: #66cc66;">&#40;</span>arr, length<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">return</span> arr.<span style="color: #006600;">slice</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">0</span>,-length<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span>,<span style="color: #CC0000;">3</span>,<span style="color: #CC0000;">4</span>,<span style="color: #CC0000;">5</span><span style="color: #66cc66;">&#93;</span>;
arr = popItems<span style="color: #66cc66;">&#40;</span>arr, <span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>;
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>arr <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// [1,2,3]</span>
&nbsp;</pre>
<p><strong>Array Splice Version</strong></p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popItems<span style="color: #66cc66;">&#40;</span>arr, length<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">return</span> arr.<span style="color: #006600;">splice</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">0</span>,arr.<span style="color: #006600;">length</span>-length<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span>,<span style="color: #CC0000;">3</span>,<span style="color: #CC0000;">4</span>,<span style="color: #CC0000;">5</span><span style="color: #66cc66;">&#93;</span>;
arr = popItems<span style="color: #66cc66;">&#40;</span>arr, <span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>;
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>arr <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// [1,2,3]</span>
&nbsp;</pre>
<p><strong>For Loop Version</strong></p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popItems<span style="color: #66cc66;">&#40;</span>arr, length<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i =<span style="color: #CC0000;">0</span>; i&lt;length; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> arr.<span style="color: #006600;">pop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> arr;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span>,<span style="color: #CC0000;">3</span>,<span style="color: #CC0000;">4</span>,<span style="color: #CC0000;">5</span><span style="color: #66cc66;">&#93;</span>;
arr = popItems<span style="color: #66cc66;">&#40;</span>arr, <span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>;
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>arr <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// [1,2,3]</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/removing-elements-from-an-array-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repeating a string without using a for loop in javascript</title>
		<link>http://mahdipedram.com/repeating-a-string-without-using-a-for-loop-in-javascript/</link>
		<comments>http://mahdipedram.com/repeating-a-string-without-using-a-for-loop-in-javascript/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:19:38 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/repeating-a-string-without-using-a-for-loop-in-javascript/</guid>
		<description><![CDATA[Even though it is not recommended to use Array constructor. but sometimes we can get some usage of it. One good example would be repeating a string without using a for loop. in this example we are creating an empty array with default undefined values. ( when you specify a size for an array, without(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Frepeating-a-string-without-using-a-for-loop-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Frepeating-a-string-without-using-a-for-loop-in-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Even though it is not recommended to use <em>Array </em>constructor. but sometimes we can get some usage of it.<br />
One good example would be repeating a string without using a for loop.</p>
<p>in this example we are creating an empty array with default undefined values.<br />
( when you specify a size for an array, without setting the values in it, it will have undefined as a default value for all the indexes)</p>
<p>by joining the new array with our string we can repeat the string as many time as we want.<br />
this is more efficient smaller and cleaner.</p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> repeatStr<span style="color: #66cc66;">&#40;</span>str,count<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span>count<span style="color: #CC0000;">+1</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">join</span><span style="color: #66cc66;">&#40;</span>str<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> str = <span style="color: #3366CC;">&quot;MyString&quot;</span>;
<span style="color: #003366; font-weight: bold;">var</span> repeatedStr = repeatStr<span style="color: #66cc66;">&#40;</span>str,<span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns MyStringMyStringMyString</span>
&nbsp;</pre>
<p>I hope you found this article helpful</p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/repeating-a-string-without-using-a-for-loop-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing Undefined Variable In Javascript</title>
		<link>http://mahdipedram.com/securing-undefined-variable-in-javascript/</link>
		<comments>http://mahdipedram.com/securing-undefined-variable-in-javascript/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 20:15:41 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[overwrite undefined]]></category>
		<category><![CDATA[secure undefined]]></category>
		<category><![CDATA[undefined javascript]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/securing-undefined-variable-in-javascript/</guid>
		<description><![CDATA[Sometimes some bad programmer or some hacker messes up with the undefined global variable in javascript. so why would we really care about it. the following are some examples that the variable undefined will be returned &#160; &#160; var myVar = undefined; //Anything that has been set to the value of undefined. &#160; function test&#40;&#41;&#123;&#125;;(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fsecuring-undefined-variable-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fsecuring-undefined-variable-in-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes some bad programmer or some hacker messes up with the undefined global variable in javascript.<br />
so why would we really care about it.</p>
<p>the following are some examples that the variable undefined will be returned</p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myVar = undefined; <span style="color: #009900; font-style: italic;">//Anything that has been set to the value of undefined.</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>; console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns undefined - Implicit returns of functions due to missing return statements.</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span>; <span style="color: #66cc66;">&#125;</span>; console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns undefined - return statements which do not explicitly return anything.</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #66cc66;">&#40;</span>a,b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>; test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns undefined - Function parameters which do not had any explicit value passed.</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> obj = <span style="color: #66cc66;">&#123;</span> a: <span style="color: #3366CC;">'test'</span> <span style="color: #66cc66;">&#125;</span>; console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">b</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns undefined - Lookups of non-existent properties.</span>
&nbsp;</pre>
<p>the undefined variable has a copy of the actual value of undefined, but if someone overwrite the value of undefined variable, that might be insecure for our code.<br />
so how could we get around this.</p>
<p>the answer is:<strong> Putting our code in a self-Invoking function. </strong></p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> undefined = <span style="color: #3366CC;">&quot;new Value&quot;</span>;
<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>input1, input2, undefined<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>undefined<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// returns undifined</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span>,<span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>this might be a neat trick if you check jQuery source code. they are also using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/securing-undefined-variable-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Type Casting In Javascript</title>
		<link>http://mahdipedram.com/type-casting-in-javascript/</link>
		<comments>http://mahdipedram.com/type-casting-in-javascript/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 18:54:49 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[casting]]></category>
		<category><![CDATA[javascript casting]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/type-casting-in-javascript/</guid>
		<description><![CDATA[I see a lot of confusion among the javascript developers when it comes to casting in javascript. Casting To A Number let's say you have a String and you want to convert it to a Number. one would say I will use parseInt() or parseFloat(). but there is even an easier way of doing it.(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Ftype-casting-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Ftype-casting-in-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I see a lot of confusion among the javascript developers when it comes to casting in javascript.</p>
<p><strong>Casting To A Number</strong></p>
<p>let's say you have a String and you want to convert it to a Number. one would say I will use parseInt() or parseFloat().</p>
<p>but there is even an easier way of doing it. no need to be worried if it is an Integer or Float.</p>
<p>Yeah, it's possible to cast to a number by using the unary plus operator</p>
<pre class="javascript">+<span style="color: #3366CC;">'20'</span> === <span style="color: #CC0000;">20</span>; <span style="color: #009900; font-style: italic;">// returns true</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> str = <span style="color: #3366CC;">&quot;20&quot;</span>;
<span style="color: #003366; font-weight: bold;">var</span> num = +str; <span style="color: #009900; font-style: italic;">// returns 20</span>
&nbsp;
str = <span style="color: #3366CC;">&quot;20.3&quot;</span>;
num = +str <span style="color: #009900; font-style: italic;">// returns 20.3</span></pre>
<p><strong>Casting To A String</strong></p>
<p>to cast a number to a string there is a tricky way of doing it.</p>
<pre class="javascript"><span style="color: #3366CC;">''</span> + <span style="color: #CC0000;">60</span> === <span style="color: #3366CC;">'60'</span>; <span style="color: #009900; font-style: italic;">// returns true</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myInt = <span style="color: #CC0000;">60</span>;
<span style="color: #003366; font-weight: bold;">var</span> myStr = myInt + <span style="color: #3366CC;">''</span>; <span style="color: #009900; font-style: italic;">// returns &quot;60&quot;</span></pre>
<p><strong>Casting To A Boolean</strong></p>
<p>you can cast to boolean by using the not operator twice !!.<br />
I see mostly people using this in their return statements. instead of doing if else. they use !!.</p>
<pre class="javascript">&nbsp;
!!<span style="color: #003366; font-weight: bold;">null</span> === !!NaN === !!undefined === !!<span style="color: #3366CC;">''</span> === !!<span style="color: #CC0000;">0</span> === <span style="color: #003366; font-weight: bold;">false</span>
!!<span style="color: #3366CC;">&quot;Any String&quot;</span> === !!<span style="color: #3366CC;">&quot;2&quot;</span> === !!<span style="color: #3366CC;">&quot;0&quot;</span> === <span style="color: #003366; font-weight: bold;">true</span>
&nbsp;</pre>
<p>I hope you found this tutorial useful. </p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/type-casting-in-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Logo with canvas</title>
		<link>http://mahdipedram.com/html5-logo-with-canvas/</link>
		<comments>http://mahdipedram.com/html5-logo-with-canvas/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 21:09:13 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5 logo]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/html5-logo-with-canvas/</guid>
		<description><![CDATA[As you guys all know, w3c has released a new logo for HTML5 which is really cool they even have made T-Shirts with HTML5 logo on it. So I was thinking to myself, what's the coolest thing that I can to promote HTML5 LOGO . Yeaaah, HTLM5 Logo With CANVAS No Need for any Image(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fhtml5-logo-with-canvas%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fhtml5-logo-with-canvas%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p> As you guys all know, w3c has released a new <a href="http://www.w3.org/html/logo/">logo</a>  for HTML5<br />
which is really cool they even have made <a href="http://html5shirt.com/">T-Shirts</a> with HTML5 logo on it.</p>
<p>So I was thinking to myself, what's the coolest thing that I can to promote HTML5 LOGO .</p>
<p><strong>Yeaaah, HTLM5 Logo With CANVAS No Need for any Image .<br />
</strong><br />
check out the <a href="http://mahdipedram.com/Demos/html5/" target="_blank">Demo</a> , make sure your browser supports Canvas.</p>
<p>canvas is supported by the current versions of Mozilla Firefox, Google Chrome, Safari, and Opera</p>
<p><a href="http://mahdipedram.com/Demos/html5/" target="_blank" style='float:left'><br />
  <img class="size-full wp-image-68 alignright" title="HTML5 Logo with CANVAS" src="http://mahdipedram.com/wp-content/uploads/45667.gif" alt="" width="150" height="68" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/html5-logo-with-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Oriented with jQuery , javascript</title>
		<link>http://mahdipedram.com/object-oriented-with-jquery-javascript/</link>
		<comments>http://mahdipedram.com/object-oriented-with-jquery-javascript/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 16:40:57 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[object oriented in javascript]]></category>
		<category><![CDATA[object oriented in jquery]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/?p=87</guid>
		<description><![CDATA[javascript is a scripting programming language that also supports Object Oriented Programming by its Prototypical Inheritance nature which is build in to the language. most of the programmers in the world are used to Classical Object Oriented paradigm, and when they first start to do OO with javascript they will have a hard time. Today(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fobject-oriented-with-jquery-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fobject-oriented-with-jquery-javascript%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>javascript is a scripting programming language that also supports Object Oriented Programming by its Prototypical Inheritance nature which is build in to the language.</p>
<p>most of the programmers in the world are used to Classical Object Oriented paradigm,  and when they first start to do OO with javascript they will have a hard time.<br />
Today what we except from Object Oriented are "Encapsulation", "Inheritance","Polymorphism","Modularity" . all these features are supported in Javscript Through prototypical Inheritance.</p>
<p><a href="http://ejohn.org/">John Resig</a> the creator of <a href="http://jquery.com"> jquery </a> has posted a nice article about <a href="http://ejohn.org/blog/simple-javascript-inheritance/">javascript inheritance</a> that is based ba Classical Object Oriented Pattern.</p>
<p>Today I'm introducing a new pattern that models Classical Object Oriented in javascript which is based on jQuery .</p>
<p>with this new architect we can easily encapsulate our code into reusable objects which are also inheritable.</p>
<h2><strong>Let's Get Started</strong></h2>
<ol>
<li><strong>Include <a href="http://jquery.com">jQuery </a>Library in your head tag ( our code is based on jQuery ).</strong></li>
<li><strong>Create Our Class or Blueprint</strong></li>
<li><strong>make a new instance of your Object through $.makeclass plugin.</strong></li>
</ol>
<p><strong>How to Code our Class or Blueprint</strong><br />
the blueprint or class structure is Modeled by a Object Literal in javascript.<br />
if we consider few things that I will go more in detail that would help you easily understand how it works.</p>
<ul>
<li>List of all reserved keywords : <strong>"Initialize"</strong>, <strong>"Public"</strong>,<strong> "Private"</strong>, <strong>"Extend"</strong>,<strong>"Static"</strong></li>
<li><strong>Initialize :</strong> basically once you create a new instance of your object this method is invoked . we didn't chose to use "constructor" cause it was a reserved<strong> </strong>word in javascript.</li>
<li><strong>Public: </strong>all public functions and variables in your class goes inside of this Public Object.</li>
<li><strong>Private</strong>: <strong> </strong>all private functions and variables in your class goes inside of this Private Object.</li>
<li><strong>Static</strong>: all Static functions and variables that is only access by the Class name it also goes in the Static Object</li>
<li>For Accessing Private variables and functions through Public functions just consider private as a first argument in your function then your welcome to do any changes.</li>
</ul>
<p>Here is a sample on how we Implement our  Blueprint or Class.</p>
<pre class="javascript">&nbsp;
   <span style="color: #003366; font-weight: bold;">var</span> Employee = <span style="color: #66cc66;">&#123;</span>
&nbsp;
        Initialize: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">private</span>, <span style="color: #000066;">name</span>, salary <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #000066;">name</span> = <span style="color: #000066;">name</span>;
          <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">salary</span> = salary;
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Private</span>:<span style="color: #66cc66;">&#123;</span>
            <span style="color: #000066;">name</span>: <span style="color: #003366; font-weight: bold;">null</span>,
            salary: <span style="color: #003366; font-weight: bold;">null</span>
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Public</span>:<span style="color: #66cc66;">&#123;</span>
            getSalary: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">private</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">salary</span>;
            <span style="color: #66cc66;">&#125;</span>,
            getName: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">private</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #000066;">name</span>;
            <span style="color: #66cc66;">&#125;</span>,
            raiseSalary: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">private</span>, byPercent<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #003366; font-weight: bold;">var</span> raise = <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">salary</span> * byPercent / <span style="color: #CC0000;">100</span>;
                <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">salary</span> += raise;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>;</pre>
<p>here is a sample class that shows how you can access to public and private and static fields </p>
<pre class="javascript">&nbsp;
 <span style="color: #003366; font-weight: bold;">var</span> SampleClass = <span style="color: #66cc66;">&#123;</span>
        Initialize: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Private</span>:<span style="color: #66cc66;">&#123;</span>
            getPrivateVar: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">privateVar</span>;
            <span style="color: #66cc66;">&#125;</span>,
            privateVar: <span style="color: #3366CC;">&quot;private var &quot;</span>
        <span style="color: #66cc66;">&#125;</span>,
        Static:<span style="color: #66cc66;">&#123;</span>
            staticVar: <span style="color: #3366CC;">&quot;staticVariable&quot;</span>
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Public</span>:<span style="color: #66cc66;">&#123;</span>
&nbsp;
            getPublicVar: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">publicVar</span>;
            <span style="color: #66cc66;">&#125;</span>,
            publicVar: <span style="color: #3366CC;">&quot;test Public Var &quot;</span>,
&nbsp;
            getPrivateFunc: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">private</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">getPrivateVar</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>;
&nbsp;</pre>
<p><strong>So What About Inheritance</strong></p>
<p>so in this case we have to consider the following three tips</p>
<ol>
<li>use the keyword <strong>Extends </strong>for extending your parent class</li>
<li>passing <strong>private </strong>as a first variable in the <strong>Initialize </strong>function.</li>
<li>if you want to have access to the super class and trigger some functions in it basically you can use<strong> "this.parent"</strong> object in any function</li>
</ol>
<p>Here is a sample on how we implement Our Inheritance</p>
<pre class="javascript">    <span style="color: #003366; font-weight: bold;">var</span> Manager = <span style="color: #66cc66;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">Extends</span>: Employee,
        Initialize: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">private</span>, <span style="color: #000066;">name</span>, salary<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span>.<span style="color: #006600;">Initialize</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">name</span>, salary <span style="color: #66cc66;">&#41;</span>;
          <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">bonus</span> = <span style="color: #CC0000;">0</span>;
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Private</span>:<span style="color: #66cc66;">&#123;</span>
            bonus: <span style="color: #003366; font-weight: bold;">null</span>
        <span style="color: #66cc66;">&#125;</span>,
        <span style="color: #003366; font-weight: bold;">Public</span>:<span style="color: #66cc66;">&#123;</span>
            getSalary: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
              <span style="color: #003366; font-weight: bold;">var</span> baseSalary = <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span>.<span style="color: #006600;">getSalary</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
              <span style="color: #000066; font-weight: bold;">return</span> baseSalary + <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">bonus</span>;
            <span style="color: #66cc66;">&#125;</span>,
            setBonus: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">private</span>, bonus <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #003366; font-weight: bold;">private</span>.<span style="color: #006600;">bonus</span> =  bonus;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>;</pre>
<p><strong>How we Instantiate it ?</strong></p>
<p>Basically we have 2 steps</p>
<ul>
<li><strong>Step1: </strong> $.makeclass does all the magic for you</li>
<li><strong>Step2: </strong> pass the CLASS definition as a first parameter and if you have some fields to be sent to the constructor just pass them after the class definition as an input</li>
</ul>
<p>Here is a sample </p>
<pre class="javascript">&nbsp;
$.<span style="color: #006600;">makeclass</span><span style="color: #66cc66;">&#40;</span>Employee ,<span style="color: #3366CC;">&quot;Bob miller&quot;</span>, <span style="color: #CC0000;">50000</span> <span style="color: #66cc66;">&#41;</span>; 
&nbsp;</pre>
<p><strong>To get jQuery MakeClass Plugin :  </strong><br />
<a href="http://www.mahdipedram.com/Plugins/jquery.makeclass.js" target="_blank" ><img class="size-full wp-image-67 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Download jQuery MakeClass Plugin" src="http://mahdipedram.com/wp-content/uploads/12334.gif" alt="" width="150" height="68" /></a></p>
<p>I have also shared this project in JS Fiddle and below you can see a Demo of it :</p>
<p><iframe style="width: 100%; height: 1000px" src="http://jsfiddle.net/pedramphp/XSbGP/15/embedded/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/object-oriented-with-jquery-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Css3 Button Maker Online Tool</title>
		<link>http://mahdipedram.com/css3-button-maker-online-tool/</link>
		<comments>http://mahdipedram.com/css3-button-maker-online-tool/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 07:49:39 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[button maker]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[css3 button maker]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/css3-button-maker-online-tool/</guid>
		<description><![CDATA[Having an optimize website followed by w3c standards has to be a primary goal for any front-end Developer. As we all know new browsers support CSS3 and HTML5 partially. it's really a good idea to master CSS3 and use it on our day to day coding life. Learning css3 avoids us using most of unnecessary(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fcss3-button-maker-online-tool%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fcss3-button-maker-online-tool%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Having an optimize website followed by w3c standards has to be a primary  goal for any front-end Developer.<br />
As we all know new browsers support CSS3 and HTML5 partially. it's really a good idea to master CSS3 and use it on our day to day coding life.</p>
<p>Learning css3 avoids us using most of unnecessary javascript and jQuery codes we write. for example round corder or box shadows are supported by css3 and most of the modern browsers support them so why would we use jQuery... ?!!!</p>
<p>Some Developers would say css3 is not supported in all browsers specially IE6 and once all browsers support it we will adapt ourselves with the new language, my Answer to those people is if you really care about your users you have to consider the majority of your users ( almost 80% ) on the net are using modern browsers to check e-mails or play <a href="http://da.partypoker.com/">Partypoker</a> so its a good idea using CSS3, HTML5 and for those remaining 20% if you really really care you can have them either not see the feature or you can just use other techniques such as javascript.<br />
moreover some remarkable and well-known companies such as <a href="http://www.html5rocks.com" target="_blank">GOOGLE</a> and <a href="http://www.apple.com/html5/" target="_blank">APPLE</a> also supports web developers switching to CSS3, HTML5. thanks to them and all other folks that contributed on it.</p>
<p>Today I'm going to introduce a CSS3 Online Tool which might going to consider using it.</p>
<hr />
<div>
<p>CSS3 BUTTON MAKER 1.0 beta has been released</p>
<p>Create your own button for your website without a need of <em>Javascript</em>, <em>Flash</em> or even <em>Images</em><br />
try it now</p>
<h3><a href="http://css3designer.com/?action=tools">CSS3 Button Maker Online Tool</a></h3>
<h2>Why using Css3 Button Maker Online Tool:</h2>
<ol>
<li> No Need for Flash</li>
<li> No Need for Javascript <span class="gray">( no more dealing with js code to tweak your button ) </span></li>
<li> No Need for Images <span class="gray">( Photoshop - images makes our site load slower) </span></li>
<li> Faster Websites - by using the browsers native built in code we end up having faster websites</li>
<li> Write more reliable and advanced css code</li>
</ol>
<h2>Css3 Button Maker Online Tools Features are listed below</h2>
<ul>
<li> Create your own button and get your CSS code.</li>
<li> Ability to create different modes of your button <span class="gray">( Link, Hover, Visited, Active ) </span></li>
<li> Border Shadow</li>
<li> Round Corner</li>
<li> Gredient Background</li>
<li> Text Shadow</li>
<li> and many many more feature...</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/css3-button-maker-online-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3Designer.com has been released</title>
		<link>http://mahdipedram.com/css3designer-com-has-been-released/</link>
		<comments>http://mahdipedram.com/css3designer-com-has-been-released/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 21:22:18 +0000</pubDate>
		<dc:creator>Mahdi Pedram</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://mahdipedram.com/css3designer-com-has-been-released/</guid>
		<description><![CDATA[For the past 3 month,our Team has been working on a new project called CSS3 Designer. Our main goal is to improve web developers and designers general knowledge on CSS3 and HTML5. Creating a flawless and perfect world on the web for all code lovers is what we want How we Developed Css3designer? Using LiteFramePHP(...)]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmahdipedram.com%2Fcss3designer-com-has-been-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmahdipedram.com%2Fcss3designer-com-has-been-released%2F&amp;source=pedramphp&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>For the past 3 month,our Team has been working on a new project called <b><a href="http://css3designer.com">CSS3 Designer</a></b>.</p>
<p>Our main goal is to improve web developers and designers general knowledge on CSS3 and HTML5. </p>
<p> Creating a flawless and perfect world on the web for all code lovers is what we want</p>
<div style='margin-top:100px;'></div>
<p><h2>How we Developed Css3designer?</h2>
<ul>
<li> Using <strong><a href='http://liteframephp.coom'>LiteFramePHP</a></strong>  in our backend which is a<strong> PHP framework</strong> that we Developed on our own</li>
<li> It's 100% <strong> HTML5 </strong> </li>
<li>  Using<strong> CSS3</strong> techniques extensively, we also follow our own css blueprint </li>
<li><strong>jQuery</strong> is our main javascript library</li>
<li>Advanced techniques in <strong>photoshop</strong></li>
</ul>
<div style='margin-top:30px;'></div>
<h2>Css3designer provides</h2>
<ul>
<li> Advanced <strong>CSS3</strong> and <strong>HTML5</strong> tutorials</li>
<li> Flexible Online <strong>CSS3</strong> ,<strong>HTML5</strong>  Developer Tools</li>
<li> and Important tips on how to <strong>design and develop </strong>you website in an efficient way. </li>
<li> Developing reliable jQuery Plugins that dynamically uses CSS3 </li>
<li> Online Training on how Develop website with <strong>Css3</strong> , <strong>HTML5 </strong>, <strong>jQuery</strong>
<li>
<li> <strong>SEO</strong> by using HTML5 in a right way
<li> how to work with <strong>Photoshop</strong> to create a faster and more reliable webpages
<li> Better world for Web Designers and Developers <img src='http://mahdipedram.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </li>
</ul>
<p><h3> Check here <a href="http://css3designer.com" style='color:#666;'> CSS3 Designer officaial website  </a></h3>
<p> and start using our site right now.<br />
 Enjoy it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mahdipedram.com/css3designer-com-has-been-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
