<?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>JQuery &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Tue, 10 Jul 2018 11:48:51 +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>JQuery &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Style Or Format JSON Data In JQuery</title>
		<link>https://mail.sibeeshpassion.com/style-or-format-json-data-in-jquery/</link>
					<comments>https://mail.sibeeshpassion.com/style-or-format-json-data-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 31 May 2016 00:00:34 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Format JSON]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[JSON in Pre Tag]]></category>
		<category><![CDATA[Style JSON Data]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11648</guid>

					<description><![CDATA[In this post we will discuss how we can format or style the JSON you get from the server. Sometimes you may need to show the exact JSON you get from your API or from server in your web page. Normally if you just bind this JSON to any pre tag, it will look like just a straight line. Isn&#8217;t it? To overcome this we have an option in jQuery . I hope you will like this. Background For the past few months I am working with some Web API projects. As you all know the preferred output of an [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can format or style the <a href="http://sibeeshpassion.com/tag/json/" target="_blank">JSON </a>you get from the server. Sometimes you may need to show the exact JSON you get from your API or from server in your web page. Normally if you just bind this JSON to any pre tag, it will look like just a straight line. Isn&#8217;t it? To overcome this we have an option in <a href="http://sibeeshpassion.com/category/jQuery/" target="_blank">jQuery </a>. I hope you will like this.</p>
<p><strong>Background</strong></p>
<p>For the past few months I am working with some <a href="http://sibeeshpassion.com/category/web-api/" target="_blank">Web API</a> projects. As you all know the preferred output of an API is JSON, I am returning JSON from my API. I wanted to show this JSON in a Pre tag as a result, but in a formatted way or stylish way. Here I am going to explain how we can do this. </p>
<p><strong>Using the code</strong></p>
<p>Before getting started, please make sure that you have added the jQuery reference to your page.</p>
<p>[html]<br />
 &lt;script src=&quot;scripts/jquery-2.2.3.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now let us say we are getting a JSON as follows from our API.</p>
<p>[js]<br />
[{&quot;AreaCode&quot;:&quot;B697-31&quot;,&quot;Revenue&quot;:12747128.190000001},{&quot;AreaCode&quot;:&quot;B697-92&quot;,&quot;Revenue&quot;:7922559.1600000048},{&quot;AreaCode&quot;:&quot;B697-76&quot;,&quot;Revenue&quot;:7541039.540000001},{&quot;AreaCode&quot;:&quot;B697-46&quot;,&quot;Revenue&quot;:7076495.5800000066},{&quot;AreaCode&quot;:&quot;B553-131&quot;,&quot;Revenue&quot;:5738816.5099999979},{&quot;AreaCode&quot;:&quot;B553-193&quot;,&quot;Revenue&quot;:4608556.52},{&quot;AreaCode&quot;:&quot;B697-74&quot;,&quot;Revenue&quot;:3895194.1099999994},{&quot;AreaCode&quot;:&quot;D158-233&quot;,&quot;Revenue&quot;:3572808.989999996},{&quot;AreaCode&quot;:&quot;B697-78&quot;,&quot;Revenue&quot;:3512657.6999999937},{&quot;AreaCode&quot;:&quot;B672-31&quot;,&quot;Revenue&quot;:2955916.9800000032},{&quot;AreaCode&quot;:&quot;B553-46&quot;,&quot;Revenue&quot;:2806813.7100000042}]<br />
[/js]</p>
<p>It will obviously looks like preceding when you just append it to a pre tag.</p>
<div id="attachment_11650" style="width: 526px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/JSON-in-Pre-Tag.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11650" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/JSON-in-Pre-Tag.png" alt="JSON in Pre Tag" width="516" height="115" class="size-full wp-image-11650" srcset="/wp-content/uploads/2016/05/JSON-in-Pre-Tag.png 516w, /wp-content/uploads/2016/05/JSON-in-Pre-Tag-300x67.png 300w, /wp-content/uploads/2016/05/JSON-in-Pre-Tag-400x89.png 400w" sizes="(max-width: 516px) 100vw, 516px" /></a><p id="caption-attachment-11650" class="wp-caption-text">JSON in Pre Tag</p></div>
<p>Now we will format this JSON string with JQuery Parse and JQuery stringify method as follows. </p>
<p>[js]<br />
  var tmpData = JSON.parse(data);<br />
                    var formattedData = JSON.stringify(tmpData, null, &#8216;\t&#8217;);<br />
                    $(&#8216;#output&#8217;).text(formattedData);<br />
[/js]</p>
<p>Here output is the id of our pre tag which we defined as follows.</p>
<p>[html]<br />
&lt;pre id=&quot;output&quot;&gt;&lt;/pre&gt;<br />
[/html]</p>
<p>Now if you bind the data after the formatting to pre tag, you will get an out put as follows. </p>
<div id="attachment_11651" style="width: 526px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output.png"><img decoding="async" aria-describedby="caption-attachment-11651" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output.png" alt="JSON in Pre Tag Output" width="516" height="861" class="size-full wp-image-11651" srcset="/wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output.png 516w, /wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output-180x300.png 180w, /wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output-400x667.png 400w, /wp-content/uploads/2016/05/JSON-in-Pre-Tag-Output-360x600.png 360w" sizes="(max-width: 516px) 100vw, 516px" /></a><p id="caption-attachment-11651" class="wp-caption-text">JSON in Pre Tag Output</p></div>
<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&#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://mail.sibeeshpassion.com/style-or-format-json-data-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change Page Layout Dynamically Using jQuery Layout Plug in</title>
		<link>https://mail.sibeeshpassion.com/change-page-layout-dynamically-using-jquery-layout-plug-in/</link>
					<comments>https://mail.sibeeshpassion.com/change-page-layout-dynamically-using-jquery-layout-plug-in/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 22 Feb 2016 09:32:31 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[Page Layout]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11287</guid>

					<description><![CDATA[In this post we are going to see how we can change the layout a page dynamically, with out writing any CSS styles for the page. Sounds cool right? Are you afraid of writing the CSS styles which will suit for all the screens like Mobiles, Tabs, Monitors, High resolution? As I am not a good designer, I was worried all the time about the resolution issues whenever I use any custom styles. Here we will be using a jQuery plugin called jQuery Layout and we do have options to set our Footer, Side bar, Header and many more. Personally [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we are going to see how we can change the layout a page dynamically, with out writing any CSS styles for the page. Sounds cool right? Are you afraid of writing the <a href="http://sibeeshpassion.com/category/CSS/" target="_blank">CSS </a>styles which will suit for all the screens like Mobiles, Tabs, Monitors, High resolution? As I am not a good designer, I was worried all the time about the resolution issues whenever I use any custom styles. Here we will be using a <a href="http://sibeeshpassion.com/category/jQuery/" target="_blank">jQuery </a>plugin called jQuery Layout and we do have options to set our Footer, Side bar, Header and many more. Personally I liked this plug in , That is why I am sharing some information about this plugin. 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/Change_Page_Layout_Dynamically_Using_jQuery_Layout_Plug_in.rar" target="_blank">Change Page Layout Dynamically </a></li>
<p><strong>Background</strong></p>
<p>I came to know about this plugin when I was searching for some page layout for my application. Then I just installed it and started using. It is pretty simple to use. You can always download the files from the plug in page <a href="http://plugins.jquery.com/layout/" target="_blank">here</a>. </p>
<p><strong>Using the code</strong></p>
<p>To start with this plug in, the first thing you are required to do is adding the necessary references. We are going to use three references, jQuery, jquery.layout-latest.js, layout-default-latest.css.</p>
<p>[html]<br />
  &lt;link href=&quot;layout-default-latest.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;script src=&quot;jquery-2.2.0.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;jquery.layout-latest.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>The next thing we need is some div elements, we can set it as follows. </p>
<p>[html]<br />
&lt;div class=&quot;ui-layout-center&quot;&gt;Content area&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-north&quot;&gt;Header&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-south&quot;&gt;Footer&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-east&quot;&gt;Sidebar&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-west&quot;&gt;Sidebar&lt;/div&gt;<br />
[/html]</p>
<p>Now we will add the scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(function () {<br />
            $(&quot;body&quot;).layout({<br />
                applyDefaultStyles:true<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Here we uses <em>applyDefaultStyles:true</em>, this is for ensuring all the required default conditions/options are being applied automatically. Now if you run your page you will be seeing a layout as follows. </p>
<div id="attachment_11288" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically.png"><img decoding="async" aria-describedby="caption-attachment-11288" src="http://sibeeshpassion.com/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-1024x484.png" alt="Change Page Layout Dynamically" width="634" height="300" class="size-large wp-image-11288" srcset="/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-1024x484.png 1024w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-300x142.png 300w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-768x363.png 768w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-400x189.png 400w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-1270x600.png 1270w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically.png 1357w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11288" class="wp-caption-text">Change Page Layout Dynamically</p></div>
<p>And this is how your page will look like when you toggle every panes. </p>
<div id="attachment_11289" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling-.png"><img decoding="async" aria-describedby="caption-attachment-11289" src="http://sibeeshpassion.com/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--1024x478.png" alt="Change Page Layout Dynamically WHen Toggling" width="634" height="296" class="size-large wp-image-11289" srcset="/wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--1024x478.png 1024w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--300x140.png 300w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--768x358.png 768w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--400x187.png 400w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling--1287x600.png 1287w, /wp-content/uploads/2016/02/Change-Page-Layout-Dynamically-WHen-Toggling-.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11289" class="wp-caption-text">Change Page Layout Dynamically WHen Toggling</p></div>
<p>Following are the key features offered by the development team as they have mentioned in their plug in home page <a href="http://layout.jquery-dev.com/index.cfm" target="_blank">here</a>.</p>
<li>simple to use: powerful but simple syntax is easy to learn</li>
<li>unlimited layout capabilities: 5 regions per layout &#8211; unlimited nesting</li>
<li>dozens of options: every aspect is customizable, globally and by region</li>
<li>total CSS control: dozens of auto-generated classes create ANY UI look</li>
<li>extensible: callbacks, methods, and special utilities provide total control</li>
<li>custom buttons: integrates with your own buttons for a custom UI look</li>
<li>collapsable: each pane can be closed, using any UI animation you want</li>
<li>hidable: panes can be completely hidden, either on startup or at any time</li>
<li>resizable: each pane can be resized, within automatic or specified limits</li>
<li>slidable: panes can also &#8216;slide open&#8217; for temporary access</li>
<li>headers &#038; footers: each region has unlimited headers or footers</li>
<li>hotkeys: can use the cursor-keys and/or define custom hotkeys</li>
<li>use any elements: use divs, iframes or any elements you want as a &#8216;pane&#8217;</li>
<li>compatible with UI widgets: integrates with jQuery widgets and plug-ins</li>
<li>demo mode: set applyDefaultStyles option for a fully functional layout</li>
<p>The developers have provided so many demo of how we can use this plugin, you can always check those <a href="http://layout.jquery-dev.com/demos.cfm" target="_blank">here</a>.</p>
<p>That is all, now you can start using this plugin. See the complete code below.</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;Change Page Layout Dynamically Using jQuery Layout Plug in&lt;/title&gt;<br />
    &lt;meta charset=&quot;utf-8&quot; /&gt;<br />
    &lt;link href=&quot;layout-default-latest.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;script src=&quot;jquery-2.2.0.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;jquery.layout-latest.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(function () {<br />
            $(&quot;body&quot;).layout({<br />
                applyDefaultStyles:true<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div class=&quot;ui-layout-center&quot;&gt;Content area&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-north&quot;&gt;Header&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-south&quot;&gt;Footer&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-east&quot;&gt;Sidebar&lt;/div&gt;<br />
    &lt;div class=&quot;ui-layout-west&quot;&gt;Sidebar&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<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’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://mail.sibeeshpassion.com/change-page-layout-dynamically-using-jquery-layout-plug-in/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Disable Dates In Datepicker</title>
		<link>https://mail.sibeeshpassion.com/disable-dates-in-datepicker/</link>
					<comments>https://mail.sibeeshpassion.com/disable-dates-in-datepicker/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 12 Nov 2015 06:28:23 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[Datepicker]]></category>
		<category><![CDATA[Disable Dates]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10962</guid>

					<description><![CDATA[In this post we will see how we can disable some dates in a jQuery datepicker control. We all worked in datepicker controls right? But in some situations we may need to add some validations like to restrict some dates in the picker so that user can not select those and move further. Here we are going to disable all the future Saturdays. I hope you will like this. Using the code The first thing you need to do is including the needed files. jQuery jQuery UI jQuery UI CSS Once you are done adding the files, you need to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can disable some dates in a <a href="http://sibeeshpassion.com/category/jquery" target="_blank">jQuery </a>datepicker control. We all worked in datepicker controls right? But in some situations we may need to add some validations like to restrict some dates in the picker so that user can not select those and move further. Here we are going to disable all the future Saturdays. I hope you will like this. </p>
<p><strong>Using the code</strong></p>
<p>The first thing you need to do is including the needed files. </p>
<p><a href="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" target="_blank">jQuery</a></p>
<p><a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" target="_blank">jQuery UI</a></p>
<p><a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css" target="_blank">jQuery UI CSS</a></p>
<p>Once you are done adding the files, you need to add a text box in which we are going to implement the picker. </p>
<p>[html]<br />
&lt;input type=&quot;text&quot; value=&quot;Select Date Here&quot;/&gt;<br />
[/html]</p>
<p>Now we will create an array which contains the list of dates we need to disable.</p>
<p>[js]<br />
var disabledDates = [&quot;2015-11-28&quot;,&quot;2015-11-14&quot;,&quot;2015-11-21&quot;]<br />
[/js]</p>
<p>Next we will load the datepicker to our text box.</p>
<p>[js]<br />
$(&#8216;input&#8217;).datepicker({<br />
    beforeShowDay: function(date){<br />
        var string = jQuery.datepicker.formatDate(&#8216;yy-mm-dd&#8217;, date);<br />
        return [ disabledDates.indexOf(string) == -1 ]<br />
    }<br />
});<br />
[/js]</p>
<p>Have you noticed that we are calling a function beforeShowDay, this is used to disable the dates. It will return false if the date exists in the disabledDates.</p>
<p>That&#8217;s all we have done it. </p>
<p>Please see the jsfiddle here: <a href="http://jsfiddle.net/sibeeshvenu/gj90f1bm/" target="_blank">Disable Date In DatePicker</a></p>
<p><strong>Output</strong></p>
<div id="attachment_10964" style="width: 333px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Disable_Dates_in_Datepicker.png"><img decoding="async" aria-describedby="caption-attachment-10964" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Disable_Dates_in_Datepicker.png" alt="Disable Dates In Datepicker" width="323" height="278" class="size-full wp-image-10964" srcset="/wp-content/uploads/2015/11/Disable_Dates_in_Datepicker.png 323w, /wp-content/uploads/2015/11/Disable_Dates_in_Datepicker-300x258.png 300w" sizes="(max-width: 323px) 100vw, 323px" /></a><p id="caption-attachment-10964" class="wp-caption-text">Disable Dates In Datepicker</p></div>
<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://mail.sibeeshpassion.com/disable-dates-in-datepicker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>a href Columns In Grid</title>
		<link>https://mail.sibeeshpassion.com/a-href-columns-in-grid/</link>
					<comments>https://mail.sibeeshpassion.com/a-href-columns-in-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 11 Nov 2015 14:18:54 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[a href Columns In Grid]]></category>
		<category><![CDATA[cellsrenderer]]></category>
		<category><![CDATA[JQXGrid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10959</guid>

					<description><![CDATA[In this post we will how we can customize a column in jQWidget jQX Grid. We will make one of the columns values to a hreaf tag. First we will load the grid from the a custom json data and then we will use cellsrenderer function to format the columns values. I hope you will like this. Background We all works in grid controls. Sometimes you may need to customize the grid and its column values. Here I am giving you custom demo of the same. In this article we are going to customize the grid column contents to a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will how we can customize a column in <a href="http://sibeeshpassion.com/category/jqwidgets/" target="_blank">jQWidget</a> jQX Grid. We will make one of the columns values to a hreaf tag. First we will load the grid from the a custom json data and then we will use cellsrenderer function to format the columns values. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>We all works in grid controls. Sometimes you may need to customize the grid and its column values. Here I am giving you custom demo of the same. In this article we are going to customize the grid column contents to a href tags.</p>
<p><strong>Using the code</strong></p>
<p>To show this demo, I am using jQWidget jQX Grid control. If you are new to jQX Grid, you can find out some introduction here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidget JQX Grid</a></p>
<p>Now we are going to load the grid first. I hope you have already checked how to load the grid. Please see the below code. </p>
<p><em>Create an HTML page</em></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><em>Add the needed references</em></p>
<p>[html]<br />
 &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Here comes the main part.</p>
<p><strong>Grid Settings or Grid Initialization</strong></p>
<p>[js]<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var columntohref = function (row, column, value) {<br />
                if (value.indexOf(&#8216;#&#8217;) != -1) {<br />
                    value = value.substring(0, value.indexOf(&#8216;#&#8217;));<br />
                }<br />
                var format = { target: &#8216;&quot;_blank&quot;&#8217; };<br />
                var html = $.jqx.dataFormat.formatlink(value, format);<br />
                return html;<br />
            }<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;LinkName&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Link&quot;, &quot;type&quot;: &quot;string&quot; }],<br />
                url: &quot;CustomData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;LinkName&quot;, &quot;dataField&quot;: &quot;LinkName&quot;, width: &quot;300&quot; }, { &quot;text&quot;: &quot;Link&quot;, &quot;dataField&quot;: &quot;Link&quot;, cellsrenderer: columntohref, width: &quot;300&quot; }]<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p><strong>Sample data</strong></p>
<p>Following is the contents of <em>CustomData.txt</em></p>
<p>[js]<br />
[{&quot;LinkName&quot;:&quot;Sibeesh Passion&quot;,&quot;Link&quot;:&quot;http://www.sibeeshpassion.com&quot;},{&quot;LinkName&quot;:&quot;C-Sharp Corner&quot;,&quot;Link&quot;:&quot;http://www.c-sharpcorner.com&quot;},{&quot;LinkName&quot;:&quot;Facebook&quot;,&quot;Link&quot;:&quot;http://www.fb.com&quot;},{&quot;LinkName&quot;:&quot;Google&quot;,&quot;Link&quot;:&quot;http://www.google.com&quot;}]<br />
[/js]</p>
<p>As you can find out in the above code we are using cellsrenderer property to call the function <em>columntohref</em> which does the formatting. We are formatting the data as below ,</p>
<p>[js]<br />
$.jqx.dataFormat.formatlink(value, format)<br />
[/js]</p>
<p>Shall we check our output now? </p>
<p><strong>Output</strong></p>
<div id="attachment_10960" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png"><img decoding="async" aria-describedby="caption-attachment-10960" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png" alt="Column values to a href" width="650" height="497" class="size-full wp-image-10960" srcset="/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png 650w, /wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918-300x229.png 300w, /wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918-400x306.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10960" class="wp-caption-text">Column values to a href</p></div>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var columntohref = function (row, column, value) {<br />
                if (value.indexOf(&#8216;#&#8217;) != -1) {<br />
                    value = value.substring(0, value.indexOf(&#8216;#&#8217;));<br />
                }<br />
                var format = { target: &#8216;&quot;_blank&quot;&#8217; };<br />
                var html = $.jqx.dataFormat.formatlink(value, format);<br />
                return html;<br />
            }<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;LinkName&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Link&quot;, &quot;type&quot;: &quot;string&quot; }],<br />
                url: &quot;CustomData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;LinkName&quot;, &quot;dataField&quot;: &quot;LinkName&quot;, width: &quot;300&quot; }, { &quot;text&quot;: &quot;Link&quot;, &quot;dataField&quot;: &quot;Link&quot;, cellsrenderer: columntohref, width: &quot;300&quot; }]<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;h2&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/h2&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/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://mail.sibeeshpassion.com/a-href-columns-in-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hoisting In JavaScript</title>
		<link>https://mail.sibeeshpassion.com/hoisting-in-javascript/</link>
					<comments>https://mail.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://mail.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://mail.sibeeshpassion.com/regex-to-remove-a-word-from-a-string/</link>
					<comments>https://mail.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://mail.sibeeshpassion.com/regex-to-remove-a-word-from-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Load Data To Grid On Sroll</title>
		<link>https://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/</link>
					<comments>https://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 02 Nov 2015 06:09:36 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[jQWidget]]></category>
		<category><![CDATA[Load data dynamically]]></category>
		<category><![CDATA[Load Data To Grid On Sroll]]></category>
		<category><![CDATA[rendergridrows]]></category>
		<category><![CDATA[virtualmode]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10886</guid>

					<description><![CDATA[In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per user request (on scrolling down). Sounds cool?. Normally what we do is, we will load all the data to the grid in a head shot, the problem in this manner is, it will take ages to load the full data to grid. Hence the user will close your application and the won&#8217;t return back. That is sad thing right? So we will concentrate on the performance part now. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I am working in a dashboard application. So for me performance was the main criteria to take care. We have used server side paging to improve the performance. This I will share in my next article. Now we will try to load a client side data on demand. Let us say when ever user scroll down. Sounds fine? Ok let us start then.</p>
<p><strong>Using the code</strong></p>
<p>To show this demo, I am using jQWidget jQX Grid control. If you are new to jQX Grid, you can find out some introduction here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidget JQX Grid</a></p>
<p>Now we are going to load the grid first. I hope you have already checked how to load the grid. Please see the below code. </p>
<p><em>Create an HTML page</em></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><em>Add the needed references</em></p>
<p>[html]<br />
 &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Here comes the main part.</p>
<p><strong>Grid Settings or Grid Initialization</strong></p>
<p>[js]<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             // generate sample data.<br />
             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can find out in the above code we are generating the data dynamically using a <a href="http://sibeeshpassion.com/function-declaration-and-function-expression/" target="_blank">function declaration</a> <em>generatedata</em>. </p>
<p>Have you noticed that in the grid settings we have given <em>virtualmode: true</em>. This is very important. This property is meant to be used for handling the dynamic data in grid. </p>
<p>And another property you must be aware of is <em>rendergridrows: rendergridrows</em>. This means, we are rendering the grid data on demand. Like when user change the pager or scroll. So we are going to call our <em>generatedata</em> function in the <em>rendergridrows</em>. We are passing the start index and end index to the function, so that the dynamic data won&#8217;t be repeated.</p>
<p>[js]<br />
var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
[/js]</p>
<p>Once the data is ready, we will pass it to the source object and source object to dataAdapter and finally dataAdapter to grid.</p>
<p>Shall we check our output now? </p>
<p><strong>Output</strong></p>
<div id="attachment_10887" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png"><img decoding="async" aria-describedby="caption-attachment-10887" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png" alt="Load Data On Scroll" width="650" height="369" class="size-full wp-image-10887" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-300x170.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-400x227.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10887" class="wp-caption-text">Load Data On Scroll</p></div>
<div id="attachment_10888" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png"><img decoding="async" aria-describedby="caption-attachment-10888" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png" alt="Load Data On Scroll" width="650" height="359" class="size-full wp-image-10888" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-300x166.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-400x221.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10888" class="wp-caption-text">Load Data On Scroll</p></div>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>     &lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/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://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Pager Using prev and next In jQuery</title>
		<link>https://mail.sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/</link>
					<comments>https://mail.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://mail.sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Function Declaration And Function Expression</title>
		<link>https://mail.sibeeshpassion.com/function-declaration-and-function-expression/</link>
					<comments>https://mail.sibeeshpassion.com/function-declaration-and-function-expression/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 00:59:00 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Difference between function declaration and function expression]]></category>
		<category><![CDATA[Function Declaration And Function Expression]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10821</guid>

					<description><![CDATA[In this post we will see the basic difference between function declaration and function expression in jQuery and JavaScript. Sometimes the developer&#8217;s getting confused between these two topics(Shhhh I ma saying about the starters like me). Basically both are same. Only difference is depends on how you handle or treat these two. We will see a basic demo here to ensure the difference between function declaration and expression. I hope you will like this. Here I am using jQuery 2.0.2 version, you can use whichever version you like. Background In my projects I am using both function declarations and function [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see the basic difference between function declaration and function expression in jQuery and JavaScript. Sometimes the developer&#8217;s getting confused between these two topics(Shhhh I ma saying about the starters like me). Basically both are same. Only difference is depends on how you handle or treat these two. We will see a basic demo here to ensure the difference between function declaration and expression. I hope you will like this.</p>
<blockquote><p>Here I am using jQuery 2.0.2 version, you can use whichever version you like. </p></blockquote>
<p><strong>Background</strong></p>
<p>In my projects I am using both function declarations and function expressions. So I thought to highlight some basic difference between them, so that it may help someone. </p>
<p><strong>Basic Difference Between Function Declaration And Function Definition</strong></p>
<li>Function declarations are loaded first, that is before any codes</li>
<li>Function expressions are loaded when the interpreter reaches that particular line of code.</li>
<li>Basically we can call any code only after the declarations are loaded</li>
<p>We will try to find out this difference with a demo.</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;Function Declaration VS Expression &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
   Function Declaration VS Expression &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then you need to include the script needed.</p>
<p>[js]<br />
&lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now we will create a function declaration as follows. </p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
		   alert(myFunctionDeclaration());<br />
           function myFunctionDeclaration()<br />
		   {<br />
				return &#8216;myFunctionDeclaration is called&#8217;;<br />
		   }<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>What will be the output of this?</p>
<div id="attachment_10822" style="width: 391px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png"><img decoding="async" aria-describedby="caption-attachment-10822" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png" alt="Function Declaration And Function Expression " width="381" height="231" class="size-full wp-image-10822" srcset="/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png 381w, /wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression-300x182.png 300w" sizes="(max-width: 381px) 100vw, 381px" /></a><p id="caption-attachment-10822" class="wp-caption-text">Function Declaration And Function Expression</p></div>
<p>Now we will change our script as follows. </p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
           function myFunctionDeclaration()<br />
		   {<br />
				return &#8216;myFunctionDeclaration is called&#8217;;<br />
		   }<br />
		   alert(myFunctionDeclaration());<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>This will also returns the same output.</p>
<div id="attachment_10822" style="width: 391px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png"><img decoding="async" aria-describedby="caption-attachment-10822" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png" alt="Function Declaration And Function Expression " width="381" height="231" class="size-full wp-image-10822" srcset="/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression.png 381w, /wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression-300x182.png 300w" sizes="(max-width: 381px) 100vw, 381px" /></a><p id="caption-attachment-10822" class="wp-caption-text">Function Declaration And Function Expression</p></div>
<p>Now we will create a function expression as follows. </p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
		  alert(myFunctionExpression());<br />
		   var myFunctionExpression = function()<br />
		   {<br />
				return &#8216;myFunctionExpression is called&#8217;;<br />
		   }<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>What may be the output of this? We will check it now. </p>
<div id="attachment_10823" style="width: 427px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression1.png"><img decoding="async" aria-describedby="caption-attachment-10823" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression1.png" alt="Function Declaration And Function Expression " width="417" height="282" class="size-full wp-image-10823" srcset="/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression1.png 417w, /wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression1-300x203.png 300w, /wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression1-400x271.png 400w" sizes="(max-width: 417px) 100vw, 417px" /></a><p id="caption-attachment-10823" class="wp-caption-text">Function Declaration And Function Expression</p></div>
<p>As you can see, instead of giving an alert it is throwing an error <em>Uncaught TypeError: myFunctionExpression is not a function</em> in the console. It is just because the function expression is not yet loaded. You are trying to call that expression before it loads.</p>
<p>So what we can do to make it work? Simple, just change the script as follows.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
                   var myFunctionExpression = function()<br />
		   {<br />
				return &#8216;myFunctionExpression is called&#8217;;<br />
		   }<br />
		   alert(myFunctionExpression());<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Now you will get an alert as follows.</p>
<div id="attachment_10824" style="width: 397px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression2.png"><img decoding="async" aria-describedby="caption-attachment-10824" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression2.png" alt="Function Declaration And Function Expression " width="387" height="207" class="size-full wp-image-10824" srcset="/wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression2.png 387w, /wp-content/uploads/2015/10/Function_Declaration_And_Function_Expression2-300x160.png 300w" sizes="(max-width: 387px) 100vw, 387px" /></a><p id="caption-attachment-10824" class="wp-caption-text">Function Declaration And Function Expression</p></div>
<p>That is all. I hope you know the difference between function declaration and function expression now. </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;Function Declaration VS Expression &#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 () {</p>
<p>		   var myFunctionExpression = function()<br />
		   {<br />
				return &#8216;myFunctionExpression is called&#8217;;<br />
		   }<br />
		   alert(myFunctionExpression());<br />
		   alert(myFunctionDeclaration());<br />
           function myFunctionDeclaration()<br />
		   {<br />
				return &#8216;myFunctionDeclaration is called&#8217;;<br />
		   }<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Function Declaration VS Expression &#8211; Sibeesh Passion<br />
	&lt;div class=&quot;first&quot;&gt;&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://mail.sibeeshpassion.com/function-declaration-and-function-expression/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Find Browser And Browser Version Using jQuery</title>
		<link>https://mail.sibeeshpassion.com/find-browser-and-browser-version-using-jquery/</link>
					<comments>https://mail.sibeeshpassion.com/find-browser-and-browser-version-using-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 00:17:20 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Find Browser And Browser Version Using jQuery]]></category>
		<category><![CDATA[jQuery Browser]]></category>
		<category><![CDATA[jquery functions]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10805</guid>

					<description><![CDATA[In this post we will see how we can find out the browser name and browser version by using jQuery. Here we will be using $.browser property og jQuery which returns the browser information. In this demo we will test this in most used browsers like Internet Explorer, Mozilla, Chrome, Opera. I hope you will like this. NB: Using $.browser is not recommended by jQuery itself, so that this feature has been moved to the jQuery.migrate plugin which is available to download if the user want. It is a vulnerable practice to use the same. Use it only if needed. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can find out the browser name and browser version by using jQuery. Here we will be using $.browser property og jQuery which returns the browser information. In this demo we will test this in most used browsers like Internet Explorer, Mozilla, Chrome, Opera. I hope you will like this.</p>
<blockquote><p>NB: Using $.browser is not recommended by jQuery itself, so that this feature has been moved to the jQuery.migrate plugin which is available to download if the user want. It is a vulnerable practice to use the same. Use it only if needed. It is always better to do not use browser specific codes. </p></blockquote>
<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;Find Browser In JQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Find Browser In JQuery &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then you need to include the script needed.</p>
<p>[js]<br />
&lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/jquery-migrate-1.2.1.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>As you have noticed I have included <em>http://code.jquery.com/jquery-migrate-1.2.1.js</em>. It is just because this feature is deprecated and moved to this js. </p>
<p>Now you need to write the scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            if ($.browser.webkit) {<br />
                alert(&quot;Hooray WebKit!&quot; +&quot; Version: &quot;+ $.browser.version);<br />
            } else if ($.browser.msie) {<br />
                alert(&quot;Hooray IE!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            } else if ($.browser.mozilla) {<br />
                alert(&quot;Hooray mozilla!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            }<br />
            $.each($.browser, function (i, val) {<br />
                $(&quot;&lt;div&gt;&quot; + i + &quot; : &lt;span&gt;&quot; + val + &quot;&lt;/span&gt;&quot;)<br />
                .appendTo(document.body);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>We are appending the browser details to the DOM. So that it is always better to use some CSS to improve the readability.</p>
<p>[css]<br />
 &lt;style&gt;<br />
        div {<br />
            width: 500px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            color: #f90;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now please run your browser, you can see the following output. </p>
<div id="attachment_10806" style="width: 427px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png"><img decoding="async" aria-describedby="caption-attachment-10806" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png" alt="Find Browser And Browser Version Using jQuery" width="417" height="243" class="size-full wp-image-10806" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png 417w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery-300x175.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery-400x233.png 400w" sizes="(max-width: 417px) 100vw, 417px" /></a><p id="caption-attachment-10806" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<div id="attachment_10807" style="width: 624px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png"><img decoding="async" aria-describedby="caption-attachment-10807" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png" alt="Find Browser And Browser Version Using jQuery" width="614" height="238" class="size-full wp-image-10807" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png 614w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1-300x116.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1-400x155.png 400w" sizes="(max-width: 614px) 100vw, 614px" /></a><p id="caption-attachment-10807" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<div id="attachment_10808" style="width: 577px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png"><img decoding="async" aria-describedby="caption-attachment-10808" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png" alt="Find Browser And Browser Version Using jQuery" width="567" height="199" class="size-full wp-image-10808" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png 567w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2-300x105.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2-400x140.png 400w" sizes="(max-width: 567px) 100vw, 567px" /></a><p id="caption-attachment-10808" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<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;Find Browser 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 src=&quot;http://code.jquery.com/jquery-migrate-1.2.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            if ($.browser.webkit) {<br />
                alert(&quot;Hooray WebKit!&quot; +&quot; Version: &quot;+ $.browser.version);<br />
            } else if ($.browser.msie) {<br />
                alert(&quot;Hooray IE!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            } else if ($.browser.mozilla) {<br />
                alert(&quot;Hooray mozilla!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            }<br />
            $.each($.browser, function (i, val) {<br />
                $(&quot;&lt;div&gt;&quot; + i + &quot; : &lt;span&gt;&quot; + val + &quot;&lt;/span&gt;&quot;)<br />
                .appendTo(document.body);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        div {<br />
            width: 500px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            color: #f90;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Find Browser In JQuery &#8211; Sibeesh Passion<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? Have you ever wanted to find out the browser details in client side? 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://mail.sibeeshpassion.com/find-browser-and-browser-version-using-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
