<?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>Dev Corner &#187; JavaScript</title>
	<atom:link href="http://devcorner.georgievi.net/category/programming/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://devcorner.georgievi.net</link>
	<description>Software Developer's Notepad</description>
	<lastBuildDate>Fri, 12 Aug 2011 20:03:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Join (concatenate) strings in JavaScript</title>
		<link>http://devcorner.georgievi.net/pages/programming/javascript/join-concatenate-strings-in-javascript</link>
		<comments>http://devcorner.georgievi.net/pages/programming/javascript/join-concatenate-strings-in-javascript#comments</comments>
		<pubDate>Wed, 07 Oct 2009 15:54:35 +0000</pubDate>
		<dc:creator>bateto</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=87</guid>
		<description><![CDATA[Problem
How to join together two strings and how to make one long string from numerous pieces?

Solution
For the purpose of a single statement, use the plus (+) operator to concatenate multiple strings.

var longString = &#34;One piece &#34; + &#34;plus one more &#34;;

To compose a string value in multiple statements, use the operator +=

var sentence = &#34;&#34;;
sentence [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>How to join together two strings and how to make one long string from numerous pieces?<br />
<span id="more-87"></span><br />
<strong>Solution</strong></p>
<p>For the purpose of a single statement, use the plus (+) operator to concatenate multiple strings.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> longString <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;One piece &quot;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;plus one more &quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To compose a string value in multiple statements, use the operator +=</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> sentence <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
sentence <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;word1 &quot;</span><span style="color: #339933;">;</span>
sentence <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;word2 &quot;</span><span style="color: #339933;">;</span>
sentence <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;word3&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We can also use and the plus for this operation, but its less elegant:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> sentence <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;word1 word2 word3&quot;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/programming/javascript/join-concatenate-strings-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the type of an element in JavaScript</title>
		<link>http://devcorner.georgievi.net/pages/programming/javascript/how-to-get-the-type-of-a-element</link>
		<comments>http://devcorner.georgievi.net/pages/programming/javascript/how-to-get-the-type-of-a-element#comments</comments>
		<pubDate>Sun, 04 Oct 2009 21:43:54 +0000</pubDate>
		<dc:creator>bateto</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=53</guid>
		<description><![CDATA[Sometimes we should find what the is the type of a given variable. In JavaScript there is a simple way to solve this problem - using the operator typeof. This operator returns as result of the check a string, which could have one of the listed values:

number
string
boolean
object
function
undefined

Example #1

typeof&#40;123&#41;;			//This will return number
typeof&#40;&#34;abd&#34;&#41;;			//This will return string
typeof&#40;false&#41;;			//This will [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we should find what the is the type of a given variable. In JavaScript there is a simple way to solve this problem <span id="more-53"></span>- using the operator <em>typeof</em>. This operator returns as result of the check a string, which could have one of the listed values:</p>
<ul>
<li>number</li>
<li>string</li>
<li>boolean</li>
<li>object</li>
<li>function</li>
<li>undefined</li>
</ul>
<p><strong>Example #1</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">123</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #006600; font-style: italic;">//This will return number</span>
<span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;abd&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #006600; font-style: italic;">//This will return string</span>
<span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #006600; font-style: italic;">//This will return boolean</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
<span style="color: #006600; font-style: italic;">//This will return string - no matter what the type of var is</span></pre></div></div>

<p>Sometimes it is possible that IE thinks that a function is actually an object.</p>
<p><strong>Example #2</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			
<span style="color: #006600; font-style: italic;">//The possible result for this operation is object, instead of function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/programming/javascript/how-to-get-the-type-of-a-element/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello JavaScript!</title>
		<link>http://devcorner.georgievi.net/pages/programming/javascript/hello-javascript</link>
		<comments>http://devcorner.georgievi.net/pages/programming/javascript/hello-javascript#comments</comments>
		<pubDate>Tue, 31 Mar 2009 07:50:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dummy]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=3</guid>
		<description><![CDATA[How to implement the simplest JavaScript code ?  &#8211; the explorer to alert with &#8220;Hello JavaScript!&#8221;
For this purpose we use the function alert(), which opens up a box with a message. In our example it&#8217;s &#8220;Hello JavaScript!&#8221;, but it could be everything.

&#60;script type=&#34;text/javascript&#34;&#62;
	window.alert&#40;&#34;Hello JavaScript!&#34;&#41;;
&#60;/script&#62;

This function is very handy when there is a debugging process [...]]]></description>
			<content:encoded><![CDATA[<p>How to implement the simplest JavaScript code ? <span id="more-3"></span> &#8211; the explorer to alert with &#8220;Hello JavaScript!&#8221;</p>
<p>For this purpose we use the function <strong>alert()</strong>, which opens up a box with a message. In our example it&#8217;s &#8220;Hello JavaScript!&#8221;, but it could be everything.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello JavaScript!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>This function is very handy when there is a debugging process for a JavaScript. But be beware not to place it in a loop. Otherwise there would be a nasty alert for a lot of times, which could make you angry and you probably will have to press the &#8220;OK&#8221; button for a thousand times.</p>
]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/programming/javascript/hello-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

