<?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>Javascript &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 11 Jul 2018 16:19:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Javascript &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Do you know JavaScript? Are you sure? &#8211; Part Two</title>
		<link>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-two/</link>
					<comments>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-two/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 05 Mar 2017 09:21:30 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JavaScript Basics]]></category>
		<category><![CDATA[JavaScript In Simple Language]]></category>
		<category><![CDATA[JavaScript Objects]]></category>
		<category><![CDATA[JavaScript Tutorial]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12082</guid>

					<description><![CDATA[Here we are going to a see an anothe article of the JavaScript series. In the first part, we have see some basics that you can start with. In this article, we will be discussing about the JavaScript object continuations and constructors etc. You can always see my other posts related to JavaScript here. We will be using Visual Studio for our development. If you are totally new to JavaScript, I strongly recommend you to read some basics here.I hope you will like this. Now let&#8217;s begin. Download source code Do you know JavaScript &#8211; Part Two Background This article [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Here we are going to a see an anothe article of the <a href="http://sibeeshpassion.com/category/JavaScript" target="_blank">JavaScript</a> series. In the <a href="http://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-1/" target="_blank">first part</a>, we have see some basics that you can start with. In this article, we will be discussing about the JavaScript object continuations and constructors etc.  You can always see my other posts related to JavaScript <a href="http://sibeeshpassion.com/category/JavaScript/" target="_blank">here</a>. We will be using <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank">Visual Studio</a> for our development. If you are totally new to JavaScript, I strongly recommend you to read some basics <a href="https://www.w3schools.com/js/" target="_blank">here</a>.I hope you will like this. Now let&#8217;s begin.</p>
<p><strong>Download source code</strong></p>
<li>
<a href="https://code.msdn.microsoft.com/Do-you-know-JavaScript-7506a9ec" target="_blank">Do you know JavaScript &#8211; Part Two</a>
</li>
<p><strong>Background</strong></p>
<p>This article is the second part of the series we have just started. If you haven&#8217;t read the first part yet, I stronglyh recommed you to read it <a href="http://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-1/" target="_blank">here</a>. </p>
<p><strong>Setting up the platform</strong></p>
<p>To get started with, here we are going to create an HTML file and JS file. </p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Do you know JavaScript? Are you sure? Part Two&lt;/title&gt;<br />
	&lt;meta charset=&quot;utf-8&quot; /&gt;<br />
    &lt;script src=&quot;JavaScript.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Let&#8217;s begin our tutorial</strong></p>
<p>Now, please open your JavaScript file. We have some scripts to write.</p>
<p><strong>Constructor</strong></p>
<p>Have you ever created any constructor in JavaScript? Before going to create a one, it is beter to know what is the need for it. Let&#8217;s start with an example. Here I am going to create an object called bike. </p>
<p>[js]<br />
var bike = {<br />
    name: &quot;Thnuderbird&quot;,<br />
    color: &quot;Blue&quot;,<br />
    CC: &quot;350&quot;,<br />
    company: &quot;Royal Enfield&quot;,<br />
    tankCapacity: &quot;20&quot;,<br />
    abs: false,<br />
    showName: function () {<br />
        console.log(this.name);<br />
    }<br />
};<br />
[/js]</p>
<p>As you can read it, this object if holdong the common properties of my bike Royal Enfield Thunderbird. Now my question is this is the only bike you know? Absolutely no, right? So suppose you need to create an object for the brand new Bajaj Dominor? What will you do? Creating an another object? So what if you know more than 10 bikes. If your anser is creating 10 objects, that&#8217;s not fair at all. Instead, why don&#8217;t we share this common properties like name, color, cc ect&#8230;So we are going to create objects but we are not going to create the properties again. So let&#8217;s crete an object for Dominor. Before doing that, we need to create a bike construcor as follows.</p>
<p>[js]<br />
function Bike(name, color, cc, company, tankCapacity, abs) {<br />
    this.name = name;<br />
    this.color = color;<br />
    this.cc = cc;<br />
    this.company = company;<br />
    this.tankCapacity = tankCapacity;<br />
    this.abs = abs;<br />
    this.showName = function () {<br />
        console.log(&#8216;The name of the currnet bike is &#8216; + this.name);<br />
    }<br />
}<br />
[/js]</p>
<p>Now we can create object for Dominor as follows. Remember, when you write the word Bike, you can see that the intellisense is shown for you as follows.</p>
<div id="attachment_12083" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Constructor_intellisence-e1488699966952.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-12083" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Constructor_intellisence-e1488699966952.png" alt="Constructor_intellisence" width="634" height="305" class="size-full wp-image-12083" srcset="/wp-content/uploads/2017/03/Constructor_intellisence-e1488699966952.png 634w, /wp-content/uploads/2017/03/Constructor_intellisence-e1488699966952-300x144.png 300w, /wp-content/uploads/2017/03/Constructor_intellisence-e1488699966952-400x192.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12083" class="wp-caption-text">Constructor_intellisence</p></div>
<p>[js]<br />
var dominor = new Bike(&quot;Dominor&quot;, &quot;Black&quot;, &quot;Bajaj&quot;, &quot;20&quot;, true);<br />
dominor.showName();<br />
[/js]</p>
<p>Have you noticed that we have not created the function showName in the object dominor but in Bike, and we are still able to use that in the object dominor. And you can see an output as preceding in your browser console. </p>
<div id="attachment_12084" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Dominor_object_output.png"><img decoding="async" aria-describedby="caption-attachment-12084" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Dominor_object_output-e1488700077335.png" alt="Dominor_object_output" width="634" height="154" class="size-full wp-image-12084" srcset="/wp-content/uploads/2017/03/Dominor_object_output-e1488700077335.png 634w, /wp-content/uploads/2017/03/Dominor_object_output-e1488700077335-300x73.png 300w, /wp-content/uploads/2017/03/Dominor_object_output-e1488700077335-400x97.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12084" class="wp-caption-text">Dominor_object_output</p></div>
<p>And you can create an object for Royal Enfield Thunderbird as follows.</p>
<p>[js]<br />
var thunderbird = new Bike(&quot;Thunderbird&quot;, &quot;Marine&quot;, &quot;Royal Enfield&quot;, &quot;20&quot;, false);<br />
thunderbird.showName();<br />
[/js]</p>
<div id="attachment_12085" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Thunderbird_output-e1488700173116.png"><img decoding="async" aria-describedby="caption-attachment-12085" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Thunderbird_output-e1488700173116.png" alt="Thunderbird_output" width="634" height="171" class="size-full wp-image-12085" srcset="/wp-content/uploads/2017/03/Thunderbird_output-e1488700173116.png 634w, /wp-content/uploads/2017/03/Thunderbird_output-e1488700173116-300x81.png 300w, /wp-content/uploads/2017/03/Thunderbird_output-e1488700173116-400x108.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12085" class="wp-caption-text">Thunderbird_output</p></div>
<p><strong>Distinguish between own and inherited properties </strong></p>
<p>As the heading implies, we have two kind of properties, own and inherited. Let&#8217;s create an example to understand that.</p>
<p>[js]<br />
var thunderbird = new Bike(&quot;Thunderbird&quot;, &quot;Marine&quot;, &quot;Royal Enfield&quot;, &quot;20&quot;, false);<br />
thunderbird.isMine = true;</p>
<p>console.log(dominor.name + &quot; is yours or not? &quot;);<br />
console.log(&quot;isMine&quot; in dominor);<br />
console.log(thunderbird.name + &quot; is yours or not? &quot;);<br />
console.log(&quot;isMine&quot; in thunderbird);<br />
console.log(&quot;toString&quot; in dominor);<br />
console.log(&quot;toString&quot; in thunderbird);<br />
[/js]</p>
<p>Before runningit, Can you please guess what will be the output of the above coce block? If you find the answer, check whether your answer matches the below output.</p>
<div id="attachment_12087" style="width: 480px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Own_and_inherited_properties.png"><img decoding="async" aria-describedby="caption-attachment-12087" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Own_and_inherited_properties.png" alt="Own_and_inherited_properties" width="470" height="170" class="size-full wp-image-12087" srcset="/wp-content/uploads/2017/03/Own_and_inherited_properties.png 470w, /wp-content/uploads/2017/03/Own_and_inherited_properties-300x109.png 300w, /wp-content/uploads/2017/03/Own_and_inherited_properties-400x145.png 400w" sizes="(max-width: 470px) 100vw, 470px" /></a><p id="caption-attachment-12087" class="wp-caption-text">Own_and_inherited_properties</p></div>
<p>So isMine is the property that we jsut added to the object thunderbird, and the same is not available in the object dominor. That&#8217;s cool. But why the property toString is available in both object, we have not added that to our object right? This is because toString method is being inherited from the Object.prototype.</p>
<p><strong>Use of hasOwnProperty</strong></p>
<p>In the above code, we have just seen how to check any property is available in our object, but that doesn&#8217;t mean it is its own property right? To check that, we can use the hasOwnProperty. Let&#8217;s find out how to use it now.</p>
<p>[js]<br />
console.log(dominor.name + &quot; is yours or not? &quot;);<br />
console.log(dominor.hasOwnProperty(&quot;isMine&quot;));<br />
console.log(thunderbird.name + &quot; is yours or not? &quot;);<br />
console.log(thunderbird.hasOwnProperty(&quot;isMine&quot;));<br />
console.log(dominor.hasOwnProperty(&quot;toString&quot;));<br />
console.log(thunderbird.hasOwnProperty(&quot;toString&quot;));<br />
[/js]</p>
<p>Once again, please try to answer it your own, before you run it. </p>
<div id="attachment_12089" style="width: 367px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/hasOwnProperty_output.png"><img decoding="async" aria-describedby="caption-attachment-12089" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/hasOwnProperty_output.png" alt="hasOwnProperty_output" width="357" height="171" class="size-full wp-image-12089" srcset="/wp-content/uploads/2017/03/hasOwnProperty_output.png 357w, /wp-content/uploads/2017/03/hasOwnProperty_output-300x144.png 300w" sizes="(max-width: 357px) 100vw, 357px" /></a><p id="caption-attachment-12089" class="wp-caption-text">hasOwnProperty_output</p></div>
<p><strong>Looping through the object</strong></p>
<p>To loopthrough the each items in an object, you can use for loop as follow.</p>
<p>[js]<br />
for (var itm in thunderbird) {<br />
    console.log(itm);<br />
}<br />
[/js]</p>
<p>This is not the preffered way as we have not checked for hasOwnProperties, we are suppose to iterate only the properties which is its own. </p>
<div id="attachment_12090" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Looping_through_the_items_in_an_Object-e1488703343380.png"><img decoding="async" aria-describedby="caption-attachment-12090" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Looping_through_the_items_in_an_Object-e1488703343380.png" alt="Looping_through_the_items_in_an_Object" width="634" height="85" class="size-full wp-image-12090" srcset="/wp-content/uploads/2017/03/Looping_through_the_items_in_an_Object-e1488703343380.png 634w, /wp-content/uploads/2017/03/Looping_through_the_items_in_an_Object-e1488703343380-300x40.png 300w, /wp-content/uploads/2017/03/Looping_through_the_items_in_an_Object-e1488703343380-400x54.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12090" class="wp-caption-text">Looping_through_the_items_in_an_Object</p></div>
<p>So let&#8217;s rewrite the above code as follows.</p>
<p>[js]<br />
for (var itm in thunderbird) {<br />
    if (thunderbird.hasOwnProperty(itm)) {<br />
        console.log(itm + &quot;:&quot; + thunderbird[itm]);<br />
    }<br />
}<br />
[/js]</p>
<p>Here is the output.</p>
<div id="attachment_12091" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Iteration_with_hasOwnProperty-e1488703903787.png"><img decoding="async" aria-describedby="caption-attachment-12091" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Iteration_with_hasOwnProperty-e1488703903787.png" alt="Iteration_with_hasOwnProperty" width="634" height="227" class="size-full wp-image-12091" srcset="/wp-content/uploads/2017/03/Iteration_with_hasOwnProperty-e1488703903787.png 634w, /wp-content/uploads/2017/03/Iteration_with_hasOwnProperty-e1488703903787-300x107.png 300w, /wp-content/uploads/2017/03/Iteration_with_hasOwnProperty-e1488703903787-400x143.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12091" class="wp-caption-text">Iteration_with_hasOwnProperty</p></div>
<p>We have seen enough about objects right? Any idea how you can delete the property from an object?</p>
<p>[js]<br />
delete thunderbird.isMine;<br />
for (var itm in thunderbird) {<br />
    if (thunderbird.hasOwnProperty(itm)) {<br />
        console.log(itm + &quot;:&quot; + thunderbird[itm]);<br />
    }<br />
}<br />
[/js]</p>
<div id="attachment_12092" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Delete_from_an_object-e1488704140711.png"><img decoding="async" aria-describedby="caption-attachment-12092" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Delete_from_an_object-e1488704140711.png" alt="Delete_from_an_object" width="634" height="216" class="size-full wp-image-12092" srcset="/wp-content/uploads/2017/03/Delete_from_an_object-e1488704140711.png 634w, /wp-content/uploads/2017/03/Delete_from_an_object-e1488704140711-300x102.png 300w, /wp-content/uploads/2017/03/Delete_from_an_object-e1488704140711-400x136.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12092" class="wp-caption-text">Delete_from_an_object</p></div>
<p>Now it is time for a question. What would be the output of the preceding code? </p>
<p>[js]<br />
console.log(delete thunderbird.toString);<br />
[/js]</p>
<p>It will return true, now run it again. What is the output? Again true? This is because of, toString is an inherited property so it won&#8217;t get deleted. So <em>thunderbird.toString</em> will always give you output.</p>
<p>That&#8217;s all for today. You can always download the source code attached to see the complete code and application. Happy coding!.</p>
<p><strong>References</strong></p>
<li><a href="https://www.w3schools.com/js/" target="_blank">JS</a></li>
<p><strong>See also</strong></p>
<li><a href="http://sibeeshpassion.com/category/JavaScript" target="_blank">Articles related to JavaScript</a></li>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-two/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Do you know JavaScript? Are you sure? &#8211; Part 1</title>
		<link>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-1/</link>
					<comments>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-1/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 28 Feb 2017 17:22:18 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JavaScript Basics]]></category>
		<category><![CDATA[JavaScript In Simple Language]]></category>
		<category><![CDATA[JavaScript Objects]]></category>
		<category><![CDATA[JavaScript Simple Demo]]></category>
		<category><![CDATA[JavaScript Tutorial]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12064</guid>

					<description><![CDATA[[toc] Introduction Here we are going to a series of articles related to JavaScript. As this is the first part of the series, here we are going to see some basics of JavaScript which you may forgot or you may not be aware of it. You can always see my other posts related to JavaScript here. We will be using Visual Studio for our development. Basically, JavaScript is a programming language of HTML and Web. Now a days we can create any kind of applications using JavaScript. If you are totally new to JavaScript, I strongly recommend you to read [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here we are going to a series of articles related to <a href="http://sibeeshpassion.com/category/JavaScript" target="_blank" rel="noopener">JavaScript</a>. As this is the first part of the series, here we are going to see some basics of JavaScript which you may forgot or you may not be aware of it. You can always see my other posts related to JavaScript <a href="http://sibeeshpassion.com/category/JavaScript/" target="_blank" rel="noopener">here</a>. We will be using <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">Visual Studio</a> for our development. Basically, JavaScript is a programming language of <a href="http://sibeeshpassion.com/category/html5/" target="_blank" rel="noopener">HTML</a> and Web. Now a days we can create any kind of applications using JavaScript. If you are totally new to JavaScript, I strongly recommend you to read some basics <a href="https://www.w3schools.com/js/" target="_blank" rel="noopener">here</a>. I hope you will like this. Now let&#8217;s begin.</p>
<h3><strong>Download source code</strong></h3>
<p>You can always download the source code from here <a href="https://code.msdn.microsoft.com/Do-you-know-JavaScript-ff7f3f98" target="_blank" rel="noopener">Do you know JavaScript &#8211; Part 1</a></p>
<h3><strong>Background</strong></h3>
<p>Recently I was assigned to a training task where I need to train one of my colleague who is a fresher and totally new to programming field. I had covered almost all the topics in my training and I am sharing few of them here. I hope you will like this.</p>
<h3>Using the code</h3>
<h4><strong>Create a HTML page</strong></h4>
<p>As we already said, JavaScript is a programming language of HTML and Web, we need a page to work with JavaScript. Let&#8217;s create it first.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;meta charset=&#8221;utf-8&#8243; /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Now create a JS file and include it in your page.</p>
<p>[js]<br />
&lt;script src=&#8221;JavaScript.js&#8221;&gt;&lt;/script&gt;<br />
[/js]</p>
<h4><strong>Let&#8217;s begin our tutorial</strong></h4>
<p>Any idea, what will be the output of the preceding lines of code.</p>
<p>[js]<br />
console.log(2 + 2);<br />
console.log(2 + &#8220;2&#8221;);<br />
console.log(2 + &#8220;2&#8221; + 2);<br />
console.log(2 + 2 + &#8220;2&#8221; + 2);<br />
console.log(2 + 2 + &#8220;2&#8221; + 2 + 2);<br />
console.log(2 + &#8220;2&#8221; + 2 + &#8220;2&#8221; + 2 + 2);<br />
console.log(&#8220;2&#8221; + 2 + &#8220;2&#8221; + 2 + 2 + 2 + 2);<br />
[/js]</p>
<p>Once after you run your application, press CTRL+SHIFT+J if you are opening your application in Google chrome or CTRL+SHIFT+K if it is Mozilla, or press F12 if in IE. This will open the browser console. Now check the output, is it the same as you thought?</p>
<div id="attachment_12065" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/02/Javascript_tutorial_output_1-e1488299369883.png"><img decoding="async" aria-describedby="caption-attachment-12065" class="size-full wp-image-12065" src="http://sibeeshpassion.com/wp-content/uploads/2017/02/Javascript_tutorial_output_1-e1488299369883.png" alt="Javascript_tutorial_output_1" width="634" height="197" srcset="/wp-content/uploads/2017/02/Javascript_tutorial_output_1-e1488299369883.png 634w, /wp-content/uploads/2017/02/Javascript_tutorial_output_1-e1488299369883-300x93.png 300w, /wp-content/uploads/2017/02/Javascript_tutorial_output_1-e1488299369883-400x124.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12065" class="wp-caption-text">Javascript_tutorial_output_1</p></div>
<p>If you noticed well, <em>console.log(2 + 2 + &#8220;2&#8221; + 2 + 2);</em> returned <em>4222</em>. First twos are added and when it comes to the third digit, the type of the result is being changed to string, so the string concatenation is happening. This is because of the dynamica nature of JavaScript.</p>
<p>So you can always add different types of values to the same variable in JavaScript. The preceding codes will always be working perfect.</p>
<p>[js]<br />
var a = 1;<br />
a = &#8220;Sibeesh&#8221;;<br />
[/js]</p>
<p>Now a simple test, what will be the output of the preceding code?</p>
<p>[js]<br />
var b;<br />
console.log(b);<br />
[/js]</p>
<p>Yes you are right it will return undefined as we have not assigned any values to the variable b. Have you ever checked the typeof an undefined variable?</p>
<p>[js]<br />
console.log(typeof(b));<br />
[/js]</p>
<p>The result will be undefined. Now what about the preceding codes?</p>
<p>[js]<br />
console.log(typeof(undefined));<br />
console.log(typeof(typeof(b)));<br />
console.log(typeof(String(b)));<br />
console.log(typeof({a:b}));<br />
console.log(typeof(null));<br />
[/js]</p>
<p>It can give you an output as below.</p>
<p>[js]<br />
undefined<br />
string<br />
string<br />
object<br />
object<br />
[/js]</p>
<p>Here one thing to be noted is, <em>typeof(typeof())</em> will always return string. And <em>{a:b}, null</em> is actually objects so the typeof will return the type as object. Let&#8217;s write a simple program now.</p>
<p>[js]<br />
var a=1;<br />
var b=a;<br />
a=2;</p>
<p>console.log(b);<br />
console.log(a);<br />
[/js]</p>
<p>See, how simple it was. Any idea what would be the output of that? If your answer is 1 &amp; 2, then you are right? Have you ever thought why is that? This is why the variable we just created are primitive types. In primitive data types the values are saved directly on the variable. If you are coming from the backgound of C#, you can understand the value typed variable.</p>
<p>Now we have one more data type which is referenced variable where values are stored as a reference not a direct values. An example for a referenced type variable is Object. Let&#8217;s go on to the next topic which is overview on JavaScript Objects, Do you know how to create an object?</p>
<p>[js]<br />
var myName = {firstName: &#8220;Sibeesh&#8221;, lastName: &#8220;Venu&#8221;};<br />
console.log(myName);<br />
console.log(JSON.stringify(myName));<br />
console.log(myName.firstName);<br />
console.log(myName.lastName);<br />
[/js]</p>
<p>Here myName is an object. You can always use JSON.stringify() to make your object to a string format and JSON.parse() to make your string to object. So the above code will give you an output as follows.</p>
<div id="attachment_12066" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/02/Javascript_tutorial_output_2-e1488300962889.png"><img decoding="async" aria-describedby="caption-attachment-12066" class="size-full wp-image-12066" src="http://sibeeshpassion.com/wp-content/uploads/2017/02/Javascript_tutorial_output_2-e1488300962889.png" alt="Javascript_tutorial_output_2" width="634" height="101" srcset="/wp-content/uploads/2017/02/Javascript_tutorial_output_2-e1488300962889.png 634w, /wp-content/uploads/2017/02/Javascript_tutorial_output_2-e1488300962889-300x48.png 300w, /wp-content/uploads/2017/02/Javascript_tutorial_output_2-e1488300962889-400x64.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12066" class="wp-caption-text">Javascript_tutorial_output_2</p></div>
<p>An object is a collection of key-value pairs, like we see in the above object, firstName is key and &#8220;Sibeesh&#8221; is value. How can we take any values from an object? We can always access a property from an object using dot(.) operator as follows.</p>
<p>[js]<br />
console.log(myName.firstName);<br />
console.log(myName.lastName);<br />
[/js]</p>
<p>And also using a bracket ([)</p>
<p>[js]<br />
console.log(myName[&#8220;firstName&#8221;]);<br />
console.log(myName[&#8220;lastName&#8221;]);<br />
[/js]</p>
<p>The above codes will give you an output as &#8220;Sibeesh&#8221; &#8220;Venu&#8221;, right? We just accesses a property from an object. Now we have given string value to our object as a key? Is there anyway we can give a key in number format? Let&#8217;s have a look.</p>
<p>[js]<br />
var myName = {1: &#8220;Sibeesh&#8221;, 2: &#8220;Venu&#8221;};<br />
[/js]</p>
<p>The question is, how can we access values of the keys 1 &amp; 2? Like below?</p>
<p>[js]<br />
console.log(myName.1);<br />
console.log(myName.2);<br />
[/js]</p>
<p>If you said &#8220;Yes&#8221;, you are wrong. If you try to accecc the values as above, This will throw an &#8220;Uncaught SyntaxError&#8221; error, so how can we access it?</p>
<p>[js]<br />
console.log(myName[&#8220;1&#8221;]);<br />
console.log(myName[&#8220;2&#8221;]);<br />
[/js]</p>
<p>So when the key value is a number, we must use [] for accessing the values. Now Lets go back to the previous object.</p>
<p>[js]<br />
var myName = {firstName: &#8220;Sibeesh&#8221;, lastName: &#8220;Venu&#8221;};<br />
var myNameCopy= myName;<br />
myName.firstName = &#8220;Sibi&#8221;;</p>
<p>console.log(myName.firstName);<br />
console.log(myNameCopy.firstName);<br />
[/js]</p>
<p>Any idea what will be the output of the above code? Have you just said Sibi Sibeesh? Oh, man. You got confused. The actual output is Sibi Sibi. As we said earlier, an object is an example of referenced type variable where the values are stored as a reference to it. So even if change the value of our first object, that will reflect is our second one too.</p>
<p>In the above examples we have created objects like below</p>
<p>[js]<br />
var myName = {firstName: &#8220;Sibeesh&#8221;, lastName: &#8220;Venu&#8221;};<br />
[/js]</p>
<p>This way of careating an object is called <em>Object literals</em>. Now the questuion is, is this the only way of creating the object? There is one more way, which is known as <em>Object Constructor</em>. Now we can create the same objects in Object constructor way.</p>
<p>[js]<br />
var myName = new Object();<br />
myName.firstName = &#8220;Sibeesh&#8221;<br />
myName.lastName = &#8220;Venu&#8221;;<br />
console.log(myName.firstName);<br />
console.log(myName.lastName);<br />
[/js]</p>
<p>Is there any rule that we can add only varibles to an object? Absolutely no, an object can hold a function too. Let&#8217;s create an object with a function inside.</p>
<p>[js]<br />
var myName = {<br />
firstName: &#8220;Sibeesh&#8221;,<br />
lastName: &#8220;Venu&#8221;,<br />
myFullName: function(){<br />
console.log(myName.firstName+&#8221; &#8220;+myName.lastName);<br />
}<br />
};<br />
[/js]</p>
<p>So the code <em>myName.myFullName();</em> will return my full name &#8220;Sibeesh Venu&#8221; as output. Right? So from the above code, we can create a functions in JavaScript as follows?</p>
<p>[js]<br />
var myFullName = function(firstName, lastName){<br />
return firstName + &#8221; &#8221; + lastName;<br />
}<br />
[/js]</p>
<p>If you call the above fucntion as preceding, you will get an output as &#8220;Sibeesh Venu&#8221;</p>
<p>[js]<br />
console.log(myFullName(&#8220;Sibeesh&#8221;,&#8221;Venu&#8221;));<br />
[/js]</p>
<p>The question is, what if we are passing only one values? Let&#8217;s try that out.</p>
<p>[js]<br />
console.log(myFullName(&#8220;Sibeesh&#8221;));<br />
[/js]</p>
<p>If you are working in any server side languages, this will actually give an error like &#8220;fucntion with one parameter couldn&#8217;t find&#8221;. But JavaScript is not like that, even if you are wrong, it will try to make you are right. So in this case, it actually treat the second parameter as undefined and give you an output as &#8220;Sibeesh undefined&#8221;.</p>
<p>That&#8217;s all for today. You can always download the source code attached to see the complete code and application. Happy coding!.</p>
<h3><strong>References</strong></h3>
<ul>
<li><a href="https://www.w3schools.com/js/" target="_blank" rel="noopener">JS</a></li>
</ul>
<h3><strong>See also</strong></h3>
<ul>
<li><a href="http://sibeeshpassion.com/category/JavaScript" target="_blank" rel="noopener">Articles related to JavaScript</a></li>
</ul>
<h3><strong>Conclusion</strong></h3>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3><strong>Your turn. What do you think?</strong></h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/do-you-know-javascript-are-you-sure-part-1/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Writing JavaScript Tests Using Jasmine Framework</title>
		<link>https://sibeeshpassion.com/writing-javascript-tests-using-jasmine-framework/</link>
					<comments>https://sibeeshpassion.com/writing-javascript-tests-using-jasmine-framework/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 10 Oct 2016 00:00:33 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Jasmine Framework]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Unit Testing With Jasmine]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11903</guid>

					<description><![CDATA[[toc] Introduction In this post we will see how we can write unit test cases in JavaScript. Here we are going to use a framework called Jasmine to write and test our unit test cases. Jasmine is a behavior driven development framework to test our JavaScript codes. The interesting things about Jasmine framework are, it doesn&#8217;t even require a DOM, independent on any framework, clean and easy. Here I will show you how we can create and run our JavaScript tests. I am going to use Visual Studio 2015 for the development. I hope you will like this article. Download [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In this post we will see how we can write unit test cases in <a href="http://sibeeshpassion.com/category/JavaScript/" target="_blank" rel="noopener">JavaScript</a>. Here we are going to use a framework called Jasmine to write and test our unit test cases. Jasmine is a behavior driven development framework to test our JavaScript codes. The interesting things about Jasmine framework are, it doesn&#8217;t even require a DOM, independent on any framework, clean and easy. Here I will show you how we can create and run our JavaScript tests. I am going to use <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank" rel="noopener">Visual Studio</a> 2015 for the development. I hope you will like this article.</p>
<h2><strong>Download source code</strong></h2>
<ul>
<li><a href="https://code.msdn.microsoft.com/Writing-JavaScript-Tests-2d1f99e9" target="_blank" rel="noopener">JavaScript Tests With Jasmine</a></li>
</ul>
<h2><strong>Background</strong></h2>
<p>As a developer, we all writes JavaScript codes for our client side developments. Am I right? It is more important to check whether the codes we have written works well. So for that we developer usually do unit testing, few developers are doing a manual testing to just check whether the functionality is working or not. But most of the MNC&#8217;s has set of rules to be followed while developing any functionalities, one of them is writing test cases, once the test cases passes, then only you will be allowed to move your codes to other environments. Here I will show you how we can write client side test cases with the help of a framework called Jasmine.</p>
<h2><strong>Setting up the project</strong></h2>
<p>To get started, please create an empty project in your Visual Studio.</p>
<div id="attachment_11904" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Empty_Project-e1475921231766.png"><img decoding="async" aria-describedby="caption-attachment-11904" class="size-full wp-image-11904" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Empty_Project-e1475921231766.png" alt="empty_project" width="650" height="507" srcset="/wp-content/uploads/2016/10/Empty_Project-e1475921231766.png 458w, /wp-content/uploads/2016/10/Empty_Project-e1475921231766-300x234.png 300w, /wp-content/uploads/2016/10/Empty_Project-e1475921231766-400x312.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11904" class="wp-caption-text">empty_project</p></div>
<p>Now, we will install <a href="http://sibeeshpassion.com/category/jquery/" target="_blank" rel="noopener">jQuery</a>, <a href="http://sibeeshpassion.com/category/jquery-ui/" target="_blank" rel="noopener">jQueryUI </a>from Nuget package manager.</p>
<div id="attachment_11905" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Nuget_Package_Manager.png"><img decoding="async" aria-describedby="caption-attachment-11905" class="size-large wp-image-11905" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Nuget_Package_Manager-1024x478.png" alt="nuget_package_manager" width="634" height="296" srcset="/wp-content/uploads/2016/10/Nuget_Package_Manager-1024x478.png 1024w, /wp-content/uploads/2016/10/Nuget_Package_Manager-300x140.png 300w, /wp-content/uploads/2016/10/Nuget_Package_Manager-768x358.png 768w, /wp-content/uploads/2016/10/Nuget_Package_Manager-400x187.png 400w, /wp-content/uploads/2016/10/Nuget_Package_Manager-1287x600.png 1287w, /wp-content/uploads/2016/10/Nuget_Package_Manager.png 1842w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11905" class="wp-caption-text">nuget_package_manager</p></div>
<p>We are all set to start our coding now.</p>
<h3><strong>Creating page and needed JS file</strong></h3>
<p>Next, we are going to create a page as preceding, with two text boxes and needed references.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Writing JavaScript test cases with Jasmine framework &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;meta charset=&#8221;utf-8&#8243; /&gt;<br />
&lt;link href=&#8221;Content/themes/base/jquery-ui.min.css&#8221; rel=&#8221;stylesheet&#8221; /&gt;<br />
&lt;link href=&#8221;Content/themes/base/base.css&#8221; rel=&#8221;stylesheet&#8221; /&gt;<br />
&lt;script src=&#8221;Scripts/jquery-3.1.1.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;Scripts/jquery-ui-1.12.1.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;Scripts/Index.js&#8221;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
Start Date: &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221; value=&#8221;&#8221; id=&#8221;dtStartDate&#8221; /&gt;<br />
End Date: &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221; value=&#8221;&#8221; id=&#8221;dtEndDate&#8221; /&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Now we can start writing our JavaScript codes in the file <em>Index.js</em>. We will start with a document ready function as preceding.</p>
<p>[js]<br />
$(function () {<br />
$(&#8220;#dtStartDate&#8221;).datepicker();<br />
$(&#8220;#dtEndDate&#8221;).datepicker();<br />
$(&#8220;#dtEndDate&#8221;).on(&#8220;change leave&#8221;, function () {<br />
});<br />
});<br />
[/js]</p>
<p>Shall we create our validation functions? We will be creating a namespace indexPage and functions. You can see the validations below.</p>
<p>[js]<br />
var indexPage = {};<br />
indexPage.validationFunctions = (function () {<br />
return {<br />
getStartDateSelectedValue: function () {<br />
return $(&#8220;#dtStartDate&#8221;).val();<br />
},<br />
getEndDateSelectedValue: function () {<br />
return $(&#8220;#dtEndDate&#8221;).val();<br />
},<br />
isNullValue: function (selVal) {<br />
if (selVal.trim() == &#8220;&#8221;) {<br />
return true;<br />
}<br />
else {<br />
return false;<br />
}<br />
},<br />
isNullValueWithUIElements: function () {<br />
if (indexPage.validationFunctions.isNullValue(indexPage.validationFunctions.getStartDateSelectedValue())<br />
&amp;&amp; indexPage.validationFunctions.isNullValue(indexPage.validationFunctions.getEndDateSelectedValue())) {<br />
alert(&#8220;The values can&#8217;t be null!.&#8221;);<br />
}<br />
},<br />
isEndDateGreaterStart: function () {<br />
var startDate = new Date(indexPage.validationFunctions.getStartDateSelectedValue());<br />
var endDate = new Date(indexPage.validationFunctions.getEndDateSelectedValue());<br />
if (startDate &lt; endDate) {<br />
return true;<br />
}<br />
else {<br />
alert(&#8220;End date must be greater than start date!.&#8221;)<br />
return false;<br />
}<br />
}<br />
}<br />
}(jQuery));<br />
[/js]</p>
<p>Hope you are able t understand the codes written. We are wrote some validations like Null value check, end date greater than start date etc&#8230;</p>
<p>Now please run your application and check whether the validations are working fine.</p>
<div id="attachment_11906" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Null_validation_check.png"><img decoding="async" aria-describedby="caption-attachment-11906" class="size-large wp-image-11906" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Null_validation_check-1024x319.png" alt="null_validation_check" width="634" height="198" srcset="/wp-content/uploads/2016/10/Null_validation_check-1024x319.png 1024w, /wp-content/uploads/2016/10/Null_validation_check-300x93.png 300w, /wp-content/uploads/2016/10/Null_validation_check-768x239.png 768w, /wp-content/uploads/2016/10/Null_validation_check-400x124.png 400w, /wp-content/uploads/2016/10/Null_validation_check.png 1231w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11906" class="wp-caption-text">null_validation_check</p></div>
<div id="attachment_11907" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Date_validation_check.png"><img decoding="async" aria-describedby="caption-attachment-11907" class="size-large wp-image-11907" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Date_validation_check-1024x319.png" alt="date_validation_check" width="634" height="198" srcset="/wp-content/uploads/2016/10/Date_validation_check-1024x319.png 1024w, /wp-content/uploads/2016/10/Date_validation_check-300x93.png 300w, /wp-content/uploads/2016/10/Date_validation_check-768x239.png 768w, /wp-content/uploads/2016/10/Date_validation_check-400x125.png 400w, /wp-content/uploads/2016/10/Date_validation_check.png 1223w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11907" class="wp-caption-text">date_validation_check</p></div>
<p>Now, here comes the real part.</p>
<h3><strong>Setting up Jasmine Framework</strong></h3>
<p>To set Jasmine, we will add a new project to our solution.</p>
<div id="attachment_11908" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Add_new_project.png"><img decoding="async" aria-describedby="caption-attachment-11908" class="size-large wp-image-11908" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Add_new_project-1024x709.png" alt="add_new_project" width="634" height="439" srcset="/wp-content/uploads/2016/10/Add_new_project-1024x709.png 1024w, /wp-content/uploads/2016/10/Add_new_project-300x208.png 300w, /wp-content/uploads/2016/10/Add_new_project-768x532.png 768w, /wp-content/uploads/2016/10/Add_new_project-160x110.png 160w, /wp-content/uploads/2016/10/Add_new_project-400x277.png 400w, /wp-content/uploads/2016/10/Add_new_project-866x600.png 866w, /wp-content/uploads/2016/10/Add_new_project.png 1178w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11908" class="wp-caption-text">add_new_project</p></div>
<p>Now install Jasmine from Nuget Package manager.</p>
<div id="attachment_11909" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Jasmine_Nuget_Package.png"><img decoding="async" aria-describedby="caption-attachment-11909" class="size-large wp-image-11909" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Jasmine_Nuget_Package-1024x570.png" alt="jasmine_nuget_package" width="634" height="353" srcset="/wp-content/uploads/2016/10/Jasmine_Nuget_Package-1024x570.png 1024w, /wp-content/uploads/2016/10/Jasmine_Nuget_Package-300x167.png 300w, /wp-content/uploads/2016/10/Jasmine_Nuget_Package-768x428.png 768w, /wp-content/uploads/2016/10/Jasmine_Nuget_Package-400x223.png 400w, /wp-content/uploads/2016/10/Jasmine_Nuget_Package-1078x600.png 1078w, /wp-content/uploads/2016/10/Jasmine_Nuget_Package.png 1491w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11909" class="wp-caption-text">jasmine_nuget_package</p></div>
<p>Once you are done, the required files would be added to your project. We will be discussing about Jasmine once everything is set. So no worries.</p>
<p>Now please add a new HTML file on your Jasmine project, this is the page where we can see the test cases in actions, and add all the references as follows.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;</p>
<p>&lt;html lang=&#8221;en&#8221; xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta charset=&#8221;utf-8&#8243; /&gt;<br />
&lt;title&gt;Jasmine Spec Runner &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;link href=&#8221;content/jasmine/jasmine.css&#8221; rel=&#8221;stylesheet&#8221; /&gt;<br />
&lt;script src=&#8221;http://localhost:12387/Scripts/jquery-3.1.1.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;http://localhost:12387/Scripts/jquery-ui-1.12.1.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;scripts/jasmine/jasmine.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;scripts/jasmine/jasmine-html.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;scripts/jasmine/console.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;scripts/jasmine/boot.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;scripts/indextests.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;http://localhost:12387/Scripts/Index.js&#8221;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<blockquote><p>Please do not forget to include the js files where we actually written the validations, jquery, jqueryui (if needed). Here indextests.js is the file where we are going to write the test cases.</p></blockquote>
<p>Normally this page is called as Spec Runner, Now you may be thinking what is a Spec? Before going further, there are some terms you must be aware of, there are listed below.</p>
<ul>
<li>Suites</li>
</ul>
<p>A suit is the starting point of a Jasmine test cases, it actually calls the global jasmine function <em>describe</em>. It can have two parameters, a string value which describes the suit, and a function which implements the suit.</p>
<ul>
<li>Spec</li>
</ul>
<p>Like suites, a spec starts with a string which can be the title of the suit and a function where we write the tests. A spec can contain one or more expectation that test the state of our code.</p>
<ul>
<li>Expectation</li>
</ul>
<p>Value of an expectation is either true or false, an expectation starts with the function <em>expect</em>. It takes a value and call the actual one.</p>
<p>You can always read more <a href="http://jasmine.github.io/2.0/introduction.html" target="_blank" rel="noopener">here</a>. Now please run your SpecRunner.html page. If everything is fine you can see a page as below.</p>
<div id="attachment_11910" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page.png"><img decoding="async" aria-describedby="caption-attachment-11910" class="size-large wp-image-11910" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page-1024x223.png" alt="jasmine_spec_runner_page" width="634" height="138" srcset="/wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page-1024x223.png 1024w, /wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page-300x65.png 300w, /wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page-768x167.png 768w, /wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page-400x87.png 400w, /wp-content/uploads/2016/10/Jasmine_Spec_Runner_Page.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11910" class="wp-caption-text">jasmine_spec_runner_page</p></div>
<p>So are you all set? Shall we go and write our test cases? Please go to your <em>IndexTest.js</em> file and create a suit and spec as preceding.</p>
<p>[js]<br />
describe(&#8220;Includes validations for index page&#8221;, function () {<br />
var indexPage;<br />
beforeEach(function () {<br />
indexPage = window.indexPage.validationFunctions;<br />
});</p>
<p>it(&#8220;Check for null values&#8221;, function () {<br />
// We are going to pass &#8220;&#8221; (null) value to the function<br />
var retVal = indexPage.isNullValue(&#8220;&#8221;);<br />
expect(retVal).toBeTruthy();<br />
});</p>
<p>});<br />
[/js]</p>
<p>Here the expectation is true and we give toBeTruthy(), now lets go and find whether the test is passed or not. Please run the SpecRunner.html page again.</p>
<div id="attachment_11911" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Test_Jasmine_Specs.png"><img decoding="async" aria-describedby="caption-attachment-11911" class="size-large wp-image-11911" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Test_Jasmine_Specs-1024x199.png" alt="test_jasmine_specs" width="634" height="123" srcset="/wp-content/uploads/2016/10/Test_Jasmine_Specs-1024x199.png 1024w, /wp-content/uploads/2016/10/Test_Jasmine_Specs-300x58.png 300w, /wp-content/uploads/2016/10/Test_Jasmine_Specs-768x149.png 768w, /wp-content/uploads/2016/10/Test_Jasmine_Specs-400x78.png 400w, /wp-content/uploads/2016/10/Test_Jasmine_Specs.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11911" class="wp-caption-text">test_jasmine_specs</p></div>
<p>Now we will write test case for our function <em>isEndDateGreaterStart</em>, if you have noticed the function <em>isEndDateGreaterStart</em>, you can see that there are dependencies (UI elements). Inside of the function, we are getting the values from the UI elements.</p>
<p>[js]<br />
var startDate = new Date(indexPage.validationFunctions.getStartDateSelectedValue());<br />
var endDate = new Date(indexPage.validationFunctions.getEndDateSelectedValue());<br />
[/js]</p>
<p>So in this case, we need to mock this values. It is known as &#8216;Spy&#8217; in Jasmine. We can use a function called <em>SpyOn</em> for this.</p>
<p>[js]<br />
it(&#8220;Spy call for datepicker date validation&#8221;, function () {<br />
//Start date as 2015-03-25<br />
spyOn(indexPage, &#8220;getStartDateSelectedValue&#8221;).and.returnValue(&#8220;2015-03-25&#8221;);<br />
//End date as 2015-03-24<br />
spyOn(indexPage, &#8220;getEndDateSelectedValue&#8221;).and.returnValue(&#8220;2015-03-24&#8221;);<br />
var retVal = indexPage.isEndDateGreaterStart();<br />
expect(retVal).toBeFalsy();<br />
});<br />
[/js]</p>
<p>Here we are giving start date as 2015-03-25 and end date as 2015-03-24 and we know 2015-03-25 &lt; 2015-03-24 is false, so here we are giving expectation as false (toBeFalsy()). Now you are getting an alert as follows right?</p>
<div id="attachment_11912" style="width: 776px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278.png"><img decoding="async" aria-describedby="caption-attachment-11912" class="size-full wp-image-11912" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278.png" alt="alert_in_spyon_jasmine" width="766" height="571" srcset="/wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278.png 478w, /wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278-300x224.png 300w, /wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278-650x485.png 650w, /wp-content/uploads/2016/10/Alert_in_SpyOn_Jasmine-e1475924905278-400x298.png 400w" sizes="(max-width: 766px) 100vw, 766px" /></a><p id="caption-attachment-11912" class="wp-caption-text">alert_in_spyon_jasmine</p></div>
<p>But in testing framework we don&#8217;t need any alerts right? To get rid of this, you must create a spy for window.alert function and add it to the <em>beforeEach</em> so that it can be used for each specs. You can do that as follows.</p>
<p>[js]<br />
window.alert = jasmine.createSpy(&#8220;alert&#8221;).and.callFake(function () { });<br />
[/js]</p>
<p>Once after you add this code, alert message won&#8217;t be thrown. Now please add an another spec with true values (Start date &#8211; 2015-03-25, End date &#8211; 2015-03-26), so that it will return true.</p>
<p>[js]<br />
it(&#8220;Spy call for datepicker date validation toBeTruthy&#8221;, function () {<br />
//Start date as 2015-03-25<br />
spyOn(indexPage, &#8220;getStartDateSelectedValue&#8221;).and.returnValue(&#8220;2015-03-25&#8221;);<br />
//End date as 2015-03-26<br />
spyOn(indexPage, &#8220;getEndDateSelectedValue&#8221;).and.returnValue(&#8220;2015-03-26&#8221;);<br />
var retVal = indexPage.isEndDateGreaterStart();<br />
expect(retVal).toBeTruthy();<br />
});<br />
[/js]</p>
<p>Now you can see all of your specs are passed.</p>
<div id="attachment_11913" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/10/Run_all_specs_in_Jasmine.png"><img decoding="async" aria-describedby="caption-attachment-11913" class="size-large wp-image-11913" src="http://sibeeshpassion.com/wp-content/uploads/2016/10/Run_all_specs_in_Jasmine-1024x217.png" alt="run_all_specs_in_jasmine" width="634" height="134" srcset="/wp-content/uploads/2016/10/Run_all_specs_in_Jasmine-1024x217.png 1024w, /wp-content/uploads/2016/10/Run_all_specs_in_Jasmine-300x64.png 300w, /wp-content/uploads/2016/10/Run_all_specs_in_Jasmine-768x163.png 768w, /wp-content/uploads/2016/10/Run_all_specs_in_Jasmine-400x85.png 400w, /wp-content/uploads/2016/10/Run_all_specs_in_Jasmine.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11913" class="wp-caption-text">run_all_specs_in_jasmine</p></div>
<p>Happy coding!.</p>
<h2><strong>Conclusion</strong></h2>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h2><strong>Your turn. What do you think?</strong></h2>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/writing-javascript-tests-using-jasmine-framework/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Programmatically Change The Element Or Page Into Full Screen Mode</title>
		<link>https://sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/</link>
					<comments>https://sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 07 Mar 2016 00:00:49 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Client Side API]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Page Into Full Screen Mode]]></category>
		<category><![CDATA[requestFullscreen]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11332</guid>

					<description><![CDATA[In this article we are going to see how we can change any element or any page into full screen mode programmatically. To do this requirement we are going to use client side API requestFullscreen . To make it compatible to all the browsers, we will be using separate API calls for each browsers. By using requestFullscreen , you can easily make the items to be viewable in a full screen mode. That&#8217;s cool right? You can use Video&#8217;s, Audio&#8217;s, Images, Pages or anything. Now shall we go and see this in detail? I hope you will like this. Download [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we are going to see how we can change any element or any page into full screen mode programmatically. To do this requirement we are going to use client side API <em>requestFullscreen </em>. To make it compatible to all the browsers, we will be using separate API calls for each browsers. By using <em>requestFullscreen </em>, you can easily make the items to be viewable in a full screen mode. That&#8217;s cool right? You can use Video&#8217;s, Audio&#8217;s, Images, Pages or anything. Now shall we go and see this in detail? I hope you will like this.</p>
<p><strong>Download the source code</strong></p>
<p>You can always download the source code here: 	</p>
<li><a href="http://sibeeshpassion.com/Download/Programmatically_Change_The_Element_Or_Page_Into_Full_Screen_Mode.rar" target="_blank">Programmatically Change The Element Or Page Into Full Screen Mode</a></li>
<p><strong>Background</strong></p>
<p>Yesterday I have got a requirement to do the full screen option programmatically in one of my application, I was required to open a chart, which is already being loaded to a page, in full screen mode. I have done that with the help of full screen API. Here I am going to show you that. Now we will start our coding. I hope you will enjoy reading. </p>
<p><strong>Create an Empty Website in Visual Studio</strong></p>
<p>Click File-> New-> Web Site.  </p>
<div id="attachment_11325" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png"><img decoding="async" aria-describedby="caption-attachment-11325" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png" alt="Empty Website In Visual Studio" width="650" height="449" class="size-full wp-image-11325" srcset="/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png 650w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-300x207.png 300w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-160x110.png 160w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-400x276.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11325" class="wp-caption-text">Empty Website In Visual Studio</p></div>
<p><strong>Create a new HTML page</strong></p>
<p>Now create a new page, start coding.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Programmatically Change The Element Or Page Into Full Screen Mode&lt;/title&gt;<br />
    &lt;meta charset=&quot;utf-8&quot; /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Using The Code</strong></p>
<p>We will be using pure JavaScript code to do this requirement. Firs of all create the container element and one other element in which we can fire the full screen function in on click event. </p>
<p>[html]<br />
  &lt;div id=&quot;container&quot; align=&quot;center&quot;&gt;&lt;/div&gt;<br />
    &lt;img src=&quot;full_screen.png&quot; onclick=&quot;changeToFullScreen()&quot; title=&quot;Click to change to full screen&quot;/&gt;<br />
[/html]</p>
<p>Here <em>changeToFullScreen()</em> is the function which does the task.</p>
<p>[js]<br />
 &lt;script&gt;<br />
        function changeToFullScreen() {<br />
            var itm = document.getElementById(&quot;container&quot;);<br />
            if (itm.requestFullscreen) {<br />
                itm.requestFullscreen();<br />
            } else if (itm.msRequestFullscreen) {<br />
                itm.msRequestFullscreen();<br />
            } else if (itm.mozRequestFullScreen) {<br />
                itm.mozRequestFullScreen();<br />
            } else if (itm.webkitRequestFullscreen) {<br />
                itm.webkitRequestFullscreen();<br />
            }<br />
        }<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Now if you run your page in Google Chrome and fire the function, you will be given an output as preceding. </p>
<div id="attachment_11333" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png"><img decoding="async" aria-describedby="caption-attachment-11333" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png" alt="Chnage_Element_To_Full_Screen_In_Google_Chrome_Error" width="650" height="487" class="size-full wp-image-11333" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png 650w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909-300x225.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909-400x300.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11333" class="wp-caption-text">Chnage_Element_To_Full_Screen_In_Google_Chrome_Error</p></div>
<p>As you can see that the window is opened in full screen, but not the element. To fix this, you must add a custom CSS style as follows. This is a hot fix which is applicable only to Google Chrome.</p>
<p>[css]<br />
#container:-webkit-full-screen {<br />
            width: 100%;<br />
            height: 100%;<br />
        }<br />
[/css]</p>
<p>Now run your page again, and make sure the fix is applied. </p>
<div id="attachment_11334" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png"><img decoding="async" aria-describedby="caption-attachment-11334" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png" alt="Chnage_Element_To_Full_Screen_In_Google_Chrome" width="650" height="588" class="size-full wp-image-11334" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png 650w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761-300x271.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761-400x362.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11334" class="wp-caption-text">Chnage_Element_To_Full_Screen_In_Google_Chrome</p></div>
<p>Now if you want to escape from full screen whenever user press any keys, you can do that too. You can add a new function as follows.</p>
<p>[js]<br />
function changeToFullScreenOnKeyPress() {<br />
            if (!document.fullscreenElement &amp;&amp; !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement &amp;&amp; !document.msFullscreenElement) {<br />
                if (document.documentElement.requestFullscreen) {<br />
                    document.documentElement.requestFullscreen();<br />
                } else if (document.documentElement.msRequestFullscreen) {<br />
                    document.documentElement.msRequestFullscreen();<br />
                } else if (document.documentElement.mozRequestFullScreen) {<br />
                    document.documentElement.mozRequestFullScreen();<br />
                } else if (document.documentElement.webkitRequestFullscreen) {<br />
                    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);<br />
                }<br />
            } else {<br />
                if (document.exitFullscreen) {<br />
                    document.exitFullscreen();<br />
                } else if (document.msExitFullscreen) {<br />
                    document.msExitFullscreen();<br />
                } else if (document.mozCancelFullScreen) {<br />
                    document.mozCancelFullScreen();<br />
                } else if (document.webkitExitFullscreen) {<br />
                    document.webkitExitFullscreen();<br />
                }<br />
            }<br />
        }<br />
[/js]</p>
<p>And you can call this function in <em>keydown</em> event as preceding.</p>
<p>[js]<br />
document.addEventListener(&quot;keydown&quot;, function (e) {<br />
            changeToFullScreenOnKeyPress();<br />
        }, false);<br />
[/js]</p>
<p>Run your page again and notice that the full screen is getting escaped whenever you press any keys. </p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Programmatically Change The Element Or Page Into Full Screen Mode&lt;/title&gt;<br />
    &lt;meta charset=&quot;utf-8&quot; /&gt;<br />
    &lt;script&gt;<br />
        function changeToFullScreen() {<br />
            var itm = document.getElementById(&quot;container&quot;);<br />
            if (itm.requestFullscreen) {<br />
                itm.requestFullscreen();<br />
            } else if (itm.msRequestFullscreen) {<br />
                itm.msRequestFullscreen();<br />
            } else if (itm.mozRequestFullScreen) {<br />
                itm.mozRequestFullScreen();<br />
            } else if (itm.webkitRequestFullscreen) {<br />
                itm.webkitRequestFullscreen();<br />
            }<br />
        }<br />
        function changeToFullScreenOnKeyPress() {<br />
            if (!document.fullscreenElement &amp;&amp; !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement &amp;&amp; !document.msFullscreenElement) {<br />
                if (document.documentElement.requestFullscreen) {<br />
                    document.documentElement.requestFullscreen();<br />
                } else if (document.documentElement.msRequestFullscreen) {<br />
                    document.documentElement.msRequestFullscreen();<br />
                } else if (document.documentElement.mozRequestFullScreen) {<br />
                    document.documentElement.mozRequestFullScreen();<br />
                } else if (document.documentElement.webkitRequestFullscreen) {<br />
                    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);<br />
                }<br />
            } else {<br />
                if (document.exitFullscreen) {<br />
                    document.exitFullscreen();<br />
                } else if (document.msExitFullscreen) {<br />
                    document.msExitFullscreen();<br />
                } else if (document.mozCancelFullScreen) {<br />
                    document.mozCancelFullScreen();<br />
                } else if (document.webkitExitFullscreen) {<br />
                    document.webkitExitFullscreen();<br />
                }<br />
            }<br />
        }<br />
        document.addEventListener(&quot;keydown&quot;, function (e) {<br />
            changeToFullScreenOnKeyPress();<br />
        }, false);<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        #container:-webkit-full-screen {<br />
            width: 100%;<br />
            height: 100%;<br />
        }<br />
        #container<br />
        {<br />
            width:72px;<br />
            height:148px;<br />
            background-image:url(&#8216;sibeeshpassionLogoSmall.png&#8217;);<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div id=&quot;container&quot; align=&quot;center&quot;&gt;&lt;/div&gt;<br />
    &lt;img src=&quot;full_screen.png&quot; onclick=&quot;changeToFullScreen()&quot; title=&quot;Click to change to full screen&quot;/&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<blockquote><p> Here <em>msRequestFullscreen</em>, <em>mozRequestFullScreen</em>, <em>webkitRequestFullscreen</em> is for Internet Explorer, Mozilla Firefox, Google Chrome respectively.</p></blockquote>
<p>We have done everything needed, Now it is time to see the output.</p>
<p><strong>Output</strong></p>
<div id="attachment_11335" style="width: 246px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Click.png"><img decoding="async" aria-describedby="caption-attachment-11335" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Click.png" alt="Chnage_Element_To_Full_Screen_Click" width="236" height="255" class="size-full wp-image-11335" /></a><p id="caption-attachment-11335" class="wp-caption-text">Chnage_Element_To_Full_Screen_Click</p></div>
<div id="attachment_11336" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output.png"><img decoding="async" aria-describedby="caption-attachment-11336" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1024x575.png" alt="Chnage_Element_To_Full_Screen_Output" width="634" height="356" class="size-large wp-image-11336" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1024x575.png 1024w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-300x169.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-768x431.png 768w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-400x225.png 400w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1068x600.png 1068w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output.png 1362w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11336" class="wp-caption-text">Chnage_Element_To_Full_Screen_Output</p></div>
<p>Have a happy coding.</p>
<p><strong>References</strong></p>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API" target="_blank">Fullscreen_API</a></li>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hoisting In JavaScript</title>
		<link>https://sibeeshpassion.com/hoisting-in-javascript/</link>
					<comments>https://sibeeshpassion.com/hoisting-in-javascript/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 06 Nov 2015 12:19:21 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Hoisting]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10955</guid>

					<description><![CDATA[In this post we will discuss the importance and limitations of Hoisting in JavaScript. We all writes client side codes. Right? But few of you might not be aware of the term Hoisting. Hoisting is one of the default behaviour of JavaScript, it is the process of moving all the declarations of the variables to the top of the current function or scope. In this post we will explain this Hoisting in detail with some examples. I hope you will like this. Background I used to spend more time with the client side codes rather than server side codes. In [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss the importance and limitations of Hoisting in <a href="http://sibeeshpassion.com/category/javascript/" target="_blank">JavaScript</a>. We all writes client side codes. Right? But few of you might not be aware of the term Hoisting. Hoisting is one of the default behaviour of JavaScript, it is the process of moving all the declarations of the variables to the top of the current function or scope. In this post we will explain this Hoisting in detail with some examples. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I used to spend more time with the client side codes rather than server side codes. In my thought is is always good if you do the formation of your data in client side instead doing it in the server side. Client side loops are always faster than the server side ones. As a client side code developer, you must understand the word Hoisting in JavaScript. Here we will discuss that.</p>
<p><strong>Using the code</strong></p>
<p>Before going through we need to know some facts in JavaScript. </p>
<p><em>Do you know?</em></p>
<p>In JavaScript we can use any variable before it is declared or a variable can be declared after it is used. </p>
<p>For Example: </p>
<p>The below two scripts will return same output.</p>
<p>[js]<br />
&lt;script&gt;<br />
x = 5;<br />
alert(x);<br />
var x;<br />
&lt;/script&gt;<br />
[/js]</p>
<p>And </p>
<p>[js]<br />
&lt;script&gt;<br />
var x;<br />
x = 5;<br />
alert(x);<br />
&lt;/script&gt;<br />
[/js]</p>
<p><strong>Limitations of Hoisting</strong></p>
<p>Even though the process of Hosting will move the declarations to the top, there is some limitations too. We will discuss it here now.</p>
<blockquote><p>Initializing a variable can not be Hoisted or In simple JavaScript Hoists declarations not initializations. </p></blockquote>
<p>For Example:</p>
<p>The below scripts will give different outputs.</p>
<p>[js]<br />
&lt;script&gt;<br />
var x = 2;<br />
var y = 4;<br />
alert(x+y);<br />
&lt;/script&gt;<br />
[/js]</p>
<p>This will give you an output of 6.</p>
<p>And </p>
<p>[js]<br />
&lt;script&gt;<br />
var x = 2;<br />
alert(x+y);<br />
var y = 4;<br />
&lt;/script&gt;<br />
[/js]</p>
<p>This will give you an output of NaN. Since we are initializing the value of y, the JavaScript Hoisting is not happening, so the y value will be undefined. The JavaScript will consider that y is not yet declared. </p>
<p>So the second example is same as of below.</p>
<p>[js]<br />
&lt;script&gt;<br />
var x = 2;<br />
var y;<br />
alert(x+y);<br />
y = 4;<br />
&lt;/script&gt;<br />
[/js]</p>
<p>This will give you an output of NaN.</p>
<div id="attachment_10956" style="width: 403px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Hoisting-In-JavaScript.png"><img decoding="async" aria-describedby="caption-attachment-10956" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Hoisting-In-JavaScript.png" alt="Hoisting In JavaScript" width="393" height="207" class="size-full wp-image-10956" srcset="/wp-content/uploads/2015/11/Hoisting-In-JavaScript.png 393w, /wp-content/uploads/2015/11/Hoisting-In-JavaScript-300x158.png 300w" sizes="(max-width: 393px) 100vw, 393px" /></a><p id="caption-attachment-10956" class="wp-caption-text">Hoisting In JavaScript</p></div>
<p><strong>Conclusion</strong></p>
<p>Since we are all developers, it is always makes things simple. So much complexity in software comes from trying to make one thing do two things. So always declare your variables on top of your function or scope. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/hoisting-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Regex to remove a word from a string</title>
		<link>https://sibeeshpassion.com/regex-to-remove-a-word-from-a-string/</link>
					<comments>https://sibeeshpassion.com/regex-to-remove-a-word-from-a-string/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 02 Nov 2015 10:13:52 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Find a word from a string]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery regex]]></category>
		<category><![CDATA[Regex to remove a word from a string]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10890</guid>

					<description><![CDATA[In this post we will see how we can remove a particular word from a string entirely in jQuery. [js] var newString= oldString.replace(/Unspecified/g, &#8221;); [/js] Here I am removing the word Unspecified from my variable oldString. Please see my other posts related to JQuery here: JQuery Posts Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can remove a particular word from a string entirely in <a href="http://sibeeshpassion.com/category/jquery" target="_blank">jQuery</a>. </p>
<p>[js]<br />
var newString= oldString.replace(/Unspecified/g, &#8221;);<br />
[/js]</p>
<p>Here I am removing the word Unspecified from my variable oldString. </p>
<p>Please see my other posts related to JQuery here: <a href="http://sibeeshpassion.com/tag/jquery/" target="_blank">JQuery Posts</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/regex-to-remove-a-word-from-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Pager Using prev and next In jQuery</title>
		<link>https://sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/</link>
					<comments>https://sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 10:44:24 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Custom Pager]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Next jQuery]]></category>
		<category><![CDATA[Prev jQuery]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10829</guid>

					<description><![CDATA[In this post we will create a custom pager using prev and next functions in jQuery. You can treat this post as a simple demo of using prev and next functions. We will be using some html UI elements and we will apply the paging functionality by using native jQuery codes. In this way you can get the information about on which page is requested by the user, once you get it, you can create an jQuery ajax call and fetch the data from the database and show. You need to know the basic of jQuery and CSS before going [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will create a custom pager using <em>prev </em>and <em>next </em> functions in <a href="http://sibeeshpassion.com/category/jquery" target="_blank">jQuery</a>. You can treat this post as a simple demo of using <em>prev </em>and <em>next </em> functions. We will be using some html UI elements and we will apply the paging functionality by using native jQuery codes. In this way you can get the information about on which page is requested by the user, once you get it, you can create an jQuery ajax call and fetch the data from the database and show. You need to know the basic of jQuery and CSS before going further. I hope you will like this.</p>
<p><strong>Background</strong></p>
<p>We can find so many pager in on-line. Here in this post I am just trying to populate my own pager. Please be noted that this is just a demo, so that you can not find more functionalities here. </p>
<p><strong>Using the code</strong></p>
<p>First thing you need to do is create a page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Prev Next In jQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
   &lt;div id=&quot;container&quot;&gt;<br />
        &lt;div id=&quot;outer&quot;&gt;<br />
            &lt;div&gt;-6&lt;/div&gt;<br />
            &lt;div&gt;-5&lt;/div&gt;<br />
            &lt;div&gt;-4&lt;/div&gt;<br />
            &lt;div&gt;-3&lt;/div&gt;<br />
            &lt;div&gt;-2&lt;/div&gt;<br />
            &lt;div&gt;-1&lt;/div&gt;<br />
            &lt;div class=&quot;first&quot;&gt;0&lt;/div&gt;<br />
            &lt;div&gt;1&lt;/div&gt;<br />
            &lt;div&gt;2&lt;/div&gt;<br />
            &lt;div&gt;3&lt;/div&gt;<br />
            &lt;div&gt;4&lt;/div&gt;<br />
            &lt;div&gt;5&lt;/div&gt;<br />
            &lt;div&gt;6&lt;/div&gt;<br />
            &lt;div&gt;7&lt;/div&gt;<br />
        &lt;/div&gt;<br />
        &lt;div&gt;<br />
            &lt;table&gt;<br />
                &lt;tr&gt;<br />
                    &lt;td class=&quot;prev&quot; title=&quot;Previous&quot;&gt;&lt;&lt;&lt;&lt;/td&gt;<br />
                    &lt;td class=&quot;next&quot; title=&quot;Next&quot;&gt;&gt;&gt;&gt;&lt;/td&gt;<br />
                &lt;/tr&gt;<br />
            &lt;/table&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then we will apply some CSS, so that it will look nice. </p>
<p>[css]<br />
 &lt;style&gt;<br />
        #outer div {<br />
            width: 20px;<br />
            height: 20px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
            float: left;<br />
            background: green;<br />
        }</p>
<p>        #outer .first {<br />
            background: blue;<br />
        }</p>
<p>        .prev, .next {<br />
            font-weight: bold;<br />
            font-size:30px;<br />
            padding:10px;<br />
            cursor:pointer;<br />
        }</p>
<p>        #container {<br />
            text-align: center;<br />
            width: 50%;<br />
            margin-left: 25%;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now add jQuery reference.</p>
<p>[js]<br />
&lt;script&gt;<br />
 &lt;script src=&quot;JQuery%20Versions/jquery-1.11.3.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Run your page and make sure that our custom pager design is fine.</p>
<div id="attachment_10830" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png"><img decoding="async" aria-describedby="caption-attachment-10830" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png" alt="Custom Pager Using prev and next In jQuery" width="650" height="103" class="size-full wp-image-10830" srcset="/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png 650w, /wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334-300x48.png 300w, /wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334-400x63.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10830" class="wp-caption-text">Custom Pager Using prev and next In jQuery</p></div>
<p>Now it is time to add our scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            var $first = $(&quot;.first&quot;);<br />
            var i = 0;<br />
            $(&quot;.prev&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.prev();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
            $(&quot;.next&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.next();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>If you notice in the code block, you can see that we are checking<em> $(&#8216;#outer div&#8217;).length / 2 < i</em> in each click. This will get true when the user clicked after the selection goes to end. We are just making the iteration to first when this occurs. </p>
<p>We are doing the above mentioned scenario both in prev click and next click. Now it is time for demo right?</p>
<p>Please see the demo here: <a href="http://sibeeshpassion.com/demo/custompager/" target="_blank">Custom Pager</a></p>
<p>That is all. We did it.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Prev Next In jQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            var $first = $(&quot;.first&quot;);<br />
            var i = 0;<br />
            $(&quot;.prev&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.prev();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
            $(&quot;.next&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.next();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        #outer div {<br />
            width: 20px;<br />
            height: 20px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
            float: left;<br />
            background: green;<br />
        }</p>
<p>        #outer .first {<br />
            background: blue;<br />
        }</p>
<p>        .prev, .next {<br />
            font-weight: bold;<br />
            font-size:30px;<br />
            padding:10px;<br />
            cursor:pointer;<br />
        }</p>
<p>        #container {<br />
            text-align: center;<br />
            width: 50%;<br />
            margin-left: 25%;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div id=&quot;container&quot;&gt;<br />
        &lt;div id=&quot;outer&quot;&gt;<br />
            &lt;div&gt;-6&lt;/div&gt;<br />
            &lt;div&gt;-5&lt;/div&gt;<br />
            &lt;div&gt;-4&lt;/div&gt;<br />
            &lt;div&gt;-3&lt;/div&gt;<br />
            &lt;div&gt;-2&lt;/div&gt;<br />
            &lt;div&gt;-1&lt;/div&gt;<br />
            &lt;div class=&quot;first&quot;&gt;0&lt;/div&gt;<br />
            &lt;div&gt;1&lt;/div&gt;<br />
            &lt;div&gt;2&lt;/div&gt;<br />
            &lt;div&gt;3&lt;/div&gt;<br />
            &lt;div&gt;4&lt;/div&gt;<br />
            &lt;div&gt;5&lt;/div&gt;<br />
            &lt;div&gt;6&lt;/div&gt;<br />
            &lt;div&gt;7&lt;/div&gt;<br />
        &lt;/div&gt;<br />
        &lt;div&gt;<br />
            &lt;table&gt;<br />
                &lt;tr&gt;<br />
                    &lt;td class=&quot;prev&quot; title=&quot;Previous&quot;&gt;&lt;&lt;&lt;&lt;/td&gt;<br />
                    &lt;td class=&quot;next&quot; title=&quot;Next&quot;&gt;&gt;&gt;&gt;&lt;/td&gt;<br />
                &lt;/tr&gt;<br />
            &lt;/table&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Check whether an array contains a particular element</title>
		<link>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/</link>
					<comments>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 30 Jun 2015 06:23:21 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[check array]]></category>
		<category><![CDATA[check element in array]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[jquery inarray]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=5531</guid>

					<description><![CDATA[Introduction Hi All, How are you today? In this article we will see how we can check whether an array element is present in an array. We will be using JQuery to do this requirement. I hope you will like it. Background I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you will be using client side arrays too. So if you use client side arrays,sometimes you may need to check the array contains a particular element [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Hi All, How are you today? In this article we will see how we can check whether an array element is present in an array. We will be using JQuery to do this requirement. I hope you will like it.</p>
<p><strong>Background</strong></p>
<p>I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you will be using client side arrays too. So if you use client side arrays,sometimes you may need to check the array contains a particular element or not.Then only you can do some codes according to that. Here I am going to give you a demo of how we can do this requirement.</p>
<p><strong>Using the code</strong></p>
<p>To start with, as you all know we need to load the JQuery reference.</p>
<p>[js]<br />
&lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Once you load the reference you are ready to go.</p>
<p>Since this is a demo, we will explain with some steps. Sounds good?. So we will do the following tasks.</p>
<li>Add the elements to the array</li>
<li>Check the elements are added or not</li>
<li>Search an element</li>
<p>Shall we start then?</p>
<p><strong>Add the elements to the array</strong></p>
<p>We need to set our UI first right?</p>
<p>[html]<br />
&lt;body&gt;<br />
    Check whether an array contains a particular element &#8211; Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;table&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;myText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;addMe&quot;&gt;Add Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;showMe&quot;&gt;Show Array Length&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;showContent&quot;&gt;Array length is<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;searchText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;searchMe&quot;&gt;Search Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;searchOutput&quot;&gt;The given text &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p>So we have set our UI, and now if you run your page you can see output as follows.</p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm1.png" alt="www.sibeeshpassion.com" /></p>
<p>Now we will add the needful scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function() {<br />
            var myArray = [];<br />
            var i = 0;<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                myArray[i] = $(&quot;#myText&quot;).val();<br />
                $(&quot;#myText&quot;).val(&#8221;);<br />
                i++;<br />
            });<br />
            $(&quot;#showMe&quot;).click(function() {<br />
                $(&quot;#showContent&quot;).text(&quot;Array length is &quot; + myArray.length);<br />
            });<br />
            $(&quot;#searchMe&quot;).click(function() {<br />
                if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can see we are adding elements to the array, checking the array element in the first two click functions. But what about the third click function. Bingo! there we are using <em>jQuery.inArray</em> function to check our element is present in the array or not.</p>
<p>No we will learn little about the <em>jQuery.inArray</em> function.</p>
<p><strong>jQuery.inArray</strong></p>
<li>It is used for searching a specified value within an array</li>
<li>It returns -1 if it does not contain the searched value</li>
<li>It returns index of the searched value if it contains the value</li>
<p>The following code block describes how we can use <em>jQuery.inArray</em></p>
<p>[js]<br />
if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>[/js]</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;html&gt;</p>
<p>&lt;head&gt;<br />
    &lt;title&gt;Check whether an array contains a particular element &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;style&gt;<br />
        p {<br />
            color: red;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
    &lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
    Check whether an array contains a particular element &#8211; Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;table&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;myText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;addMe&quot;&gt;Add Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;showMe&quot;&gt;Show Array Length&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;showContent&quot;&gt;Array length is<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;searchText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;searchMe&quot;&gt;Search Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;searchOutput&quot;&gt;The given text &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function() {<br />
            var myArray = [];<br />
            var i = 0;<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                myArray[i] = $(&quot;#myText&quot;).val();<br />
                $(&quot;#myText&quot;).val(&#8221;);<br />
                i++;<br />
            });<br />
            $(&quot;#showMe&quot;).click(function() {<br />
                $(&quot;#showContent&quot;).text(&quot;Array length is &quot; + myArray.length);<br />
            });<br />
            $(&quot;#searchMe&quot;).click(function() {<br />
                if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;<br />
[/html]</p>
<p>Now we will run our page and see the output.</p>
<p><strong>Output</strong></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm2.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm3.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm4.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelmgif.gif" alt="www.sibeeshpassion.com" /></p>
<p>That is all.</p>
<p><strong>Conclusion</strong></p>
<p>I hope you will like this article. Please share me your valuable thoughts and comments. Your feedback is always welcomed.</p>
<p>Thanks in advance. Happy coding!</p>
<p>Kindest Regards<br />
<a href="https://plus.google.com/+sibeeshkv" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Basic DOM Manipulation in JavaScript</title>
		<link>https://sibeeshpassion.com/basic-dom-manipulation-in-javascript/</link>
					<comments>https://sibeeshpassion.com/basic-dom-manipulation-in-javascript/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 29 Jan 2015 19:44:34 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Dom Manipulations]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JS]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=971</guid>

					<description><![CDATA[Introduction We are all familiar with JavaScript. This article is for those who have not touched JavaScript yet. Here I will tell you how to do simple DOM manipulations in JavaScript. Creation If you want to create a new element in the DOM, you can do as follows: [js] Var myDiv = document.createElement(‘div’); [/js] Addition If you want to add a new element to the existing element, you can do as follows. [js] document.body.appendChild(div); [/js] Here I am appending a div to the body. Style manipulation If you want to add some styles to an existing element, you can do [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>We are all familiar with JavaScript. This article is for those who have not touched JavaScript yet. Here I will tell you how to do simple DOM manipulations in JavaScript.</p>
<p><strong>Creation</strong></p>
<p>If you want to create a new element in the DOM, you can do as follows:<br />
[js]<br />
Var myDiv = document.createElement(‘div’);<br />
[/js]<br />
<strong>Addition</strong></p>
<p>If you want to add a new element to the existing element, you can do as follows.<br />
[js]<br />
document.body.appendChild(div);<br />
[/js]<br />
Here I am appending a div to the body.</p>
<p><strong>Style manipulation</strong></p>
<p>If you want to add some styles to an existing element, you can do as follows.</p>
<p><strong>Positioning</strong><br />
[js]<br />
div.style.right = ‘142px’;<br />
div.style.left = ’26px’;<br />
Modification<br />
[/js]<br />
<strong>Using classes:</strong> </p>
<p>If you want to assign a class name to an existing element, you can do as follows:<br />
[js]<br />
div.className = ‘myClassName’;<br />
[/js]<br />
<strong>Using ID:</strong><br />
[js]<br />
div.id = ‘myID’;<br />
[/js]<br />
<strong>Change the contents</strong></p>
<p><strong>using HTML:</strong><br />
[js]<br />
div.innerHTML = ‘&lt;div class=”myClassName”&gt;This is my HTML&lt;/div&gt;’;<br />
[/js]<br />
<strong>using text:</strong><br />
[js]<br />
div.textContent = ‘This is my text’;<br />
[/js]<br />
<strong>Removal</strong></p>
<p><strong>To remove an element from the DOM:</strong><br />
[js]<br />
div.parentNode.removeChild(div);<br />
[/js]<br />
Here we are removing a div from the parent node.</p>
<p><strong>Accessing</strong></p>
<p>We can access the elements in several ways. Let us see that now.</p>
<p><strong>ID</strong><br />
[js]<br />
document.getElementById(‘myID’);<br />
[/js]<br />
<strong>Tags</strong><br />
[js]<br />
document.getElementsByTagName(‘p’);<br />
[/js]<br />
<strong>Class</strong><br />
[js]<br />
document.getElementsByClassName(‘myClassName’);<br />
[/js]<br />
<strong>CSS selector</strong><br />
[js]<br />
document.querySelector(‘div #myID .myClassName’);<br />
[/js]<br />
That’s all for today. I hope someone finds this useful. Thanks for reading.</p>
<p>Kindest Regards,<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/basic-dom-manipulation-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Generate Screenshot Using HTML and JavaScript</title>
		<link>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/</link>
					<comments>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 29 Dec 2014 19:27:11 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[create screenshot using jquery]]></category>
		<category><![CDATA[generate screenshot]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[take screenshot]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=711</guid>

					<description><![CDATA[Introduction Generate a screenshot using HTML and JavaScript, yeah that is what I meant. I was just searching for some unanswered article here, one member was asking about this, so I thought I would write a tip about that. Here it is, you can see the actual article reference here. Procedure Step 1 You need an HTML page with some JavaScript code andCSS. That&#8217;s all we need. Create an HTML file just like this: [html] &#60;html lang=“en”&#62; &#60;head&#62; &#60;title&#62;Take Web Page Screenshot with HTML5 and JavaScript &#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&#62;Generate Screenshot »&#60;/a&#62; &#60;/body&#62; &#60;/html&#62; [/html] Step [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Generate a screenshot using HTML and JavaScript, yeah that is what I meant. I was just searching for some unanswered article here, one member was asking about this, so I thought I would write a tip about that. Here it is, you can see the actual article reference <a href="http://www.xpertdeveloper.com/2012/10/webpage-screenshot-with-html5-js/" rel="nofollow">here</a>.</p>
<p><strong>Procedure</strong></p>
<p><strong>Step 1</strong></p>
<p>You need an HTML page with some JavaScript code andCSS. That&#8217;s all we need.</p>
<p>Create an HTML file just like this:</p>
<p>[html]<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Take Web Page Screenshot with HTML5 and JavaScript &lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&gt;Generate<br />
        Screenshot »&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Step 2</strong></p>
<p>If you want, you can create some styles and apply them.</p>
<p>Now it&#8217;s time to create the JavaScript function generate() that I specified in an &lt;a&gt; tag.<br />
[html]<br />
&lt;script type=“text/javascript”&gt;<br />
        (function (exports) {<br />
            function urlsToAbsolute(nodeList) {<br />
                if (!nodeList.length) {<br />
                    return [];<br />
                }<br />
                var attrName = ‘href’;<br />
                if (nodeList[0].__proto__ === HTMLImageElement.prototype || nodeList[0].__proto__ ===<br />
                 HTMLScriptElement.prototype) {<br />
                    attrName = ‘src’;<br />
                }<br />
                nodeList = [].map.call(nodeList, function (el, i) {<br />
                    var attr = el.getAttribute(attrName);<br />
                    if (!attr) {<br />
                        return;<br />
                    }<br />
                    var absURL = /^(https?|data):/i.test(attr);<br />
                    if (absURL) {<br />
                        return el;<br />
                    } else {<br />
                        return el;<br />
                    }<br />
                });<br />
                return nodeList;<br />
            }<br />
            function screenshotPage() {<br />
                urlsToAbsolute(document.images);<br />
                urlsToAbsolute(document.querySelectorAll(“link[rel=’stylesheet’]”));<br />
                var screenshot = document.documentElement.cloneNode(true);<br />
                var b = document.createElement(‘base’);<br />
                b.href = document.location.protocol + ‘//’ + location.host;<br />
                var head = screenshot.querySelector(‘head’);<br />
                head.insertBefore(b, head.firstChild);<br />
                screenshot.style.pointerEvents = ‘none’;<br />
                screenshot.style.overflow = ‘hidden’;<br />
                screenshot.style.webkitUserSelect = ‘none’;<br />
                screenshot.style.mozUserSelect = ‘none’;<br />
                screenshot.style.msUserSelect = ‘none’;<br />
                screenshot.style.oUserSelect = ‘none’;<br />
                screenshot.style.userSelect = ‘none’;<br />
                screenshot.dataset.scrollX = window.scrollX;<br />
                screenshot.dataset.scrollY = window.scrollY;<br />
                var script = document.createElement(‘script’);<br />
                script.textContent = ‘(‘ + addOnPageLoad_.toString() + ‘)();’;<br />
                screenshot.querySelector(‘body’).appendChild(script);<br />
                var blob = new Blob([screenshot.outerHTML], {<br />
                    type: ‘text/html’<br />
                });<br />
                return blob;<br />
            }<br />
            function addOnPageLoad_() {<br />
                window.addEventListener(‘DOMContentLoaded’, function (e) {<br />
                    var scrollX = document.documentElement.dataset.scrollX || 0;<br />
                    var scrollY = document.documentElement.dataset.scrollY || 0;<br />
                    window.scrollTo(scrollX, scrollY);<br />
                });<br />
            }<br />
            function generate() {<br />
                window.URL = window.URL || window.webkitURL;<br />
                window.open(window.URL.createObjectURL(screenshotPage()));<br />
            }<br />
            exports.screenshotPage = screenshotPage;<br />
            exports.generate = generate;<br />
        })(window);<br />
    &lt;/script&gt;<br />
[/html]</p>
<p><strong>Complete Code</strong></p>
<p><strong>Screenshot.html</strong><br />
[html]<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Take Web Page Screenshot with HTML5 and JavaScript &lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&gt;Generate<br />
        Screenshot »&lt;/a&gt;<br />
    &lt;script type=“text/javascript”&gt;<br />
        (function (exports) {<br />
            function urlsToAbsolute(nodeList) {<br />
                if (!nodeList.length) {<br />
                    return [];<br />
                }<br />
                var attrName = ‘href’;<br />
                if (nodeList[0].__proto__ === HTMLImageElement.prototype || nodeList[0].__p                   roto__ === HTMLScriptElement.prototype) {<br />
                    attrName = ‘src’;<br />
                }<br />
                nodeList = [].map.call(nodeList, function (el, i) {<br />
                    var attr = el.getAttribute(attrName);<br />
                    if (!attr) {<br />
                        return;<br />
                    }<br />
                    var absURL = /^(https?|data):/i.test(attr);<br />
                    if (absURL) {<br />
                        return el;<br />
                    } else {<br />
                        return el;<br />
                    }<br />
                });<br />
                return nodeList;<br />
            }<br />
            function screenshotPage() {<br />
                urlsToAbsolute(document.images);<br />
                urlsToAbsolute(document.querySelectorAll(“link[rel=’stylesheet’]”));<br />
                var screenshot = document.documentElement.cloneNode(true);<br />
                var b = document.createElement(‘base’);<br />
                b.href = document.location.protocol + ‘//’ + location.host;<br />
                var head = screenshot.querySelector(‘head’);<br />
                head.insertBefore(b, head.firstChild);<br />
                screenshot.style.pointerEvents = ‘none’;<br />
                screenshot.style.overflow = ‘hidden’;<br />
                screenshot.style.webkitUserSelect = ‘none’;<br />
                screenshot.style.mozUserSelect = ‘none’;<br />
                screenshot.style.msUserSelect = ‘none’;<br />
                screenshot.style.oUserSelect = ‘none’;<br />
                screenshot.style.userSelect = ‘none’;<br />
                screenshot.dataset.scrollX = window.scrollX;<br />
                screenshot.dataset.scrollY = window.scrollY;<br />
                var script = document.createElement(‘script’);<br />
                script.textContent = ‘(‘ + addOnPageLoad_.toString() + ‘)();’;<br />
                screenshot.querySelector(‘body’).appendChild(script);<br />
                var blob = new Blob([screenshot.outerHTML], {<br />
                    type: ‘text/html’<br />
                });<br />
                return blob;<br />
            }<br />
            function addOnPageLoad_() {<br />
                window.addEventListener(‘DOMContentLoaded’, function (e) {<br />
                    var scrollX = document.documentElement.dataset.scrollX || 0;<br />
                    var scrollY = document.documentElement.dataset.scrollY || 0;<br />
                    window.scrollTo(scrollX, scrollY);<br />
                });<br />
            }<br />
            function generate() {<br />
                window.URL = window.URL || window.webkitURL;<br />
                window.open(window.URL.createObjectURL(screenshotPage()));<br />
            }<br />
            exports.screenshotPage = screenshotPage;<br />
            exports.generate = generate;<br />
        })(window);<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Please share me your valuable suggestions and feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
