<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8494313944502597205</id><updated>2024-09-05T10:04:08.779-07:00</updated><category term="JavaScript"/><category term="jquery"/><category term="Css"/><category term="DOM"/><category term="Page"/><category term="Restful WCF"/><category term="plugin"/><title type='text'>Rajiv Kumar Srivastava</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rajiv-srivastava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rajiv-srivastava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rajiv Kumar Srivastava</name><uri>http://www.blogger.com/profile/11440422052942571637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8494313944502597205.post-9054915105065411953</id><published>2012-10-17T11:37:00.002-07:00</published><updated>2017-01-09T21:21:21.464-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Css"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Page"/><title type='text'>Make Your Pages Load Faster</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #cc0000; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;Here is some tips which will make your page load faster&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Avoid table layouts and use Div.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Don&#39;t use images to display text.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Call up your images through css if possible.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Use contextual selectors&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Use shorthand css properties.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Remove white space, line breaks, and commented tags.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Use relative path instead of absolute&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Remove unnecessary Meta tags and Meta contents.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Put you css and&amp;nbsp;JavaScript&amp;nbsp;in&amp;nbsp;separate&amp;nbsp;files.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Use &#39;/&#39; and the end&amp;nbsp;directory&amp;nbsp;links.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Use compressed version of css and JS files&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;Enable compression on your IIS while deploying the site on IIS.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rajiv-srivastava.blogspot.com/feeds/9054915105065411953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/make-your-pages-load-faster.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/9054915105065411953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/9054915105065411953'/><link rel='alternate' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/make-your-pages-load-faster.html' title='Make Your Pages Load Faster'/><author><name>Rajiv Kumar Srivastava</name><uri>http://www.blogger.com/profile/11440422052942571637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8494313944502597205.post-490891114938321815</id><published>2012-10-11T08:42:00.003-07:00</published><updated>2012-10-12T07:50:31.555-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOM"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>How to check Complete Page Load by JavaScript </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;In a client-side&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;application&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;. your application is&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;initializing any control or populating a large amount of data in your control.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;You need to execute a script after&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DOM is ready and ALL of the other assets in the page (images, etc.) are loaded.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Use &lt;b&gt;window.onload&lt;/b&gt; event. This event will not fire until both&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; line-height: 18px;&quot;&gt;DOM is ready and ALL of the other assets in the page (images, etc.) are loaded.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Once your page is loaded&amp;nbsp;completely this event&amp;nbsp;automatically&amp;nbsp;fired.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;There is other way&amp;nbsp;around put &lt;b&gt;onload &lt;/b&gt;event in your body tag.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;If you need to execute some script after your page load in your js file.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;window&lt;/span&gt;.onload = &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;(){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #274e13;&quot;&gt;// Write your script&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; alert(&lt;span style=&quot;color: #990000;&quot;&gt;&quot;Page is loaded completely&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rajiv-srivastava.blogspot.com/feeds/490891114938321815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/how-to-check-complete-page-load-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/490891114938321815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/490891114938321815'/><link rel='alternate' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/how-to-check-complete-page-load-by.html' title='How to check Complete Page Load by JavaScript '/><author><name>Rajiv Kumar Srivastava</name><uri>http://www.blogger.com/profile/11440422052942571637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8494313944502597205.post-3642884961819221060</id><published>2012-10-07T06:38:00.001-07:00</published><updated>2012-10-16T10:20:14.727-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><title type='text'>How to create a jquery plugin control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; font-size: 16px; line-height: 24px; text-align: justify;&quot;&gt;This post will explain you to create a jQuery plugin, here we will create a simple plugin which will show your input as an alert. It&#39;s just few line of code and very easy to use.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; font-size: 16px; line-height: 24px; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; font-size: 16px; line-height: 24px; text-align: justify;&quot;&gt;We will start with JS file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; font-size: 16px; line-height: 24px; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Step 1&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;.&lt;/span&gt;&lt;b style=&quot;color: #1e1e1e;&quot;&gt; Create a JS file. And name it &quot;alertService.js&quot;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;To start with JS. First you need to add function as given below to start with your plugin. Rest of your plugin code will come under this.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;($) {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;})(jQuery);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;-----------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;($) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt; //Here we put the name of the plugin..&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; // and input parameters will comes in options object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; $.fn.alertService = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;(options) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// here we put the default values to the parameters&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;defaults = {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messege:&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// if user pass the parameters then it will pick those. Other wise pick default parameter and put it in options&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;options = $.extend(defaults, options);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// function which will be called form this plugin.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;alertMessege() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;(&quot;This messege is coming from alertService. And your input text is &quot;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt; + options.messege);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// Here we call the alertMessege function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $.fn.alertService = alertMessege();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;})(jQuery);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #1e1e1e;&quot;&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;----------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Step 2&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;. &lt;b&gt;Now we need to call this plugin form our page.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;Here you need to add a Jquery file in your page&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;I am using&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 24px; text-align: left;&quot;&gt;&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;jquery-1.4.1.js. You can use any of the version which is available with you.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 24px; text-align: left;&quot;&gt;&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;Add your Plugin js &quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; line-height: 24px;&quot;&gt;alertService.js&quot; in your page.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, &#39;Times New Roman&#39;; line-height: 24px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Scripts/jquery-1.4.1.js&quot;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;text/javascript&quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Scripts/js/alertService.js&quot;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;text/javascript&quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;language&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(document).ready(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;).alertService({&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messege:&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt; &quot;Test Pass&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj38V9UxDIo9pxysAULSDNajp-WvPLgsIdpsczrSPWFceR0X9OsHO6gyq33eMP_ayn0pBPzdqn8psCfdWBc__BhHph7fQ1Q7qQ1sp1iw1MlqOCDlI9QE3D3oQkDTPIFz6PUTV7jyAxwKzI/s1600/Untitled.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;115&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj38V9UxDIo9pxysAULSDNajp-WvPLgsIdpsczrSPWFceR0X9OsHO6gyq33eMP_ayn0pBPzdqn8psCfdWBc__BhHph7fQ1Q7qQ1sp1iw1MlqOCDlI9QE3D3oQkDTPIFz6PUTV7jyAxwKzI/s320/Untitled.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;color: #1e1e1e;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, Times New Roman;&quot;&gt;&lt;span style=&quot;line-height: 24px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rajiv-srivastava.blogspot.com/feeds/3642884961819221060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/how-to-create-jquery-plugin-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/3642884961819221060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/3642884961819221060'/><link rel='alternate' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/how-to-create-jquery-plugin-control.html' title='How to create a jquery plugin control'/><author><name>Rajiv Kumar Srivastava</name><uri>http://www.blogger.com/profile/11440422052942571637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj38V9UxDIo9pxysAULSDNajp-WvPLgsIdpsczrSPWFceR0X9OsHO6gyq33eMP_ayn0pBPzdqn8psCfdWBc__BhHph7fQ1Q7qQ1sp1iw1MlqOCDlI9QE3D3oQkDTPIFz6PUTV7jyAxwKzI/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8494313944502597205.post-4202651648368834367</id><published>2012-10-02T11:42:00.001-07:00</published><updated>2012-10-03T09:36:09.411-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="Restful WCF"/><title type='text'>Restful WCF service with Jquery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is my first post about how to call a WCF service with jquery.&lt;br /&gt;
&lt;br /&gt;
This post will describe how do you pass your parameters through your jquery ajax method to a WCF service.&lt;br /&gt;
&lt;br /&gt;
First we will start with WCF Service....(Restful Service)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Step 1.&lt;/span&gt; &lt;b&gt;Create a WCF Service Application&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIX32vBzNWRS6MV7bKQTmK4WC9GxjoHaGqGiuzb2fF_1Xu6nIrzaV50XA8eY9BGYArWLU-z_UBuHTPuLFV3-_m4QuzyvWYJj5vZQx-X68EAcppd509Ob2bUFVMMebPfBc_t-_kKV_Grk/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIX32vBzNWRS6MV7bKQTmK4WC9GxjoHaGqGiuzb2fF_1Xu6nIrzaV50XA8eY9BGYArWLU-z_UBuHTPuLFV3-_m4QuzyvWYJj5vZQx-X68EAcppd509Ob2bUFVMMebPfBc_t-_kKV_Grk/s400/1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Step 2.&lt;/span&gt;&lt;/span&gt; &amp;nbsp;&lt;b&gt;Open your IService1.cs File and put the below code there...&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Collections.Generic;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Linq;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Runtime.Serialization;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.ServiceModel;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.ServiceModel.Web;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Text;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;namespace &lt;/span&gt;RestFullService&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; [&lt;span style=&quot;color: #6aa84f;&quot;&gt;ServiceContract&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; public interface&lt;/span&gt; &lt;span style=&quot;color: #6aa84f;&quot;&gt;IService1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;span style=&quot;color: #6aa84f;&quot;&gt;OperationContract&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;span style=&quot;color: #6aa84f;&quot;&gt;WebInvoke&lt;/span&gt;(Method = &quot;&lt;span style=&quot;color: #f6b26b;&quot;&gt;PUT&lt;/span&gt;&quot;, UriTemplate = &quot;&lt;span style=&quot;color: #f6b26b;&quot;&gt;/Test&lt;/span&gt;&quot;, RequestFormat = &lt;span style=&quot;color: #6aa84f;&quot;&gt;WebMessageFormat&lt;/span&gt;.Json, ResponseFormat = &lt;span style=&quot;color: #6aa84f;&quot;&gt;WebMessageFormat&lt;/span&gt;.Json, BodyStyle = &lt;span style=&quot;color: #6aa84f;&quot;&gt;WebMessageBodyStyle&lt;/span&gt;.WrappedRequest)]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;Test(&lt;span style=&quot;color: #6aa84f;&quot;&gt;Parameters &lt;/span&gt;param);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; [&lt;span style=&quot;color: #6aa84f;&quot;&gt;DataContract&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; public class&lt;/span&gt; &lt;span style=&quot;color: #6aa84f;&quot;&gt;Parameters&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;span style=&quot;color: #6aa84f;&quot;&gt;DataMember&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; public string&lt;/span&gt; Value { get; set; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;Step 3&lt;/span&gt;. Now open your&amp;nbsp;Service1.svc.cs File and paste the below code there...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Collections.Generic;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Linq;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Runtime.Serialization;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.ServiceModel;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.ServiceModel.Web;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Text;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Web.Script.Serialization;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using &lt;/span&gt;System.Data;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;namespace &lt;/span&gt;RestFullService&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; public class&lt;/span&gt; &lt;span style=&quot;color: #6aa84f;&quot;&gt;Service1 &lt;/span&gt;: &lt;span style=&quot;color: #6aa84f;&quot;&gt;IService1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; public string&lt;/span&gt; Test(&lt;span style=&quot;color: blue;&quot;&gt;Parameters &lt;/span&gt;param)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;JavaScriptSerializer &lt;/span&gt;jSerializer = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;JavaScriptSerializer&lt;/span&gt;();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;dynamic &lt;/span&gt;oParam = jSerializer.Deserialize&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;(param.Value);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;Employee &lt;/span&gt;emp = new &lt;span style=&quot;color: #6aa84f;&quot;&gt;Employee&lt;/span&gt;();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;DataTable &lt;/span&gt;dtEmployee = emp.GetEmployee(oParam[&quot;&lt;span style=&quot;color: #e69138;&quot;&gt;id&lt;/span&gt;&quot;], oParam[&quot;&lt;span style=&quot;color: #e69138;&quot;&gt;name&lt;/span&gt;&quot;]);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; //Here is the code to Serialize the Datatable&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; //This will serialize you databale as a List Array.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;gt;&amp;gt; lstSerializeList = new &lt;span style=&quot;color: #6aa84f;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;gt;&amp;gt;();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;Array&lt;/span&gt;.ForEach(dtEmployee.Select(), row =&amp;gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;gt;&amp;nbsp;Dictionary = new&amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;gt;();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;foreach &lt;/span&gt;(&lt;span style=&quot;color: #6aa84f;&quot;&gt;DataColumn &lt;/span&gt;col in dtEmployee.Columns)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dictionary.Add(col.ColumnName, row[col]);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lstSerializeList.Add(Dictionary);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;jSerializer.Serialize(lstSerializeList);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt; &lt;span style=&quot;color: #6aa84f;&quot;&gt;Employee&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; //Call your Database as your way to get the Data&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; // I am using DataTable as a return type...&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;DataTable&lt;/span&gt; GetEmployee(&lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;id,&lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;Name)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt; //Do your Code here&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; return new&lt;/span&gt; &lt;span style=&quot;color: #6aa84f;&quot;&gt;DataTable&lt;/span&gt;();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;Step 4&lt;/span&gt;. &lt;b&gt;We are done with WCF. Now we will call Javascript to call this service and pass parameters.&lt;/b&gt;&lt;b&gt;&amp;nbsp;For this we will add a empty web application which will consume this service and pass parameters to it.&amp;nbsp;&lt;/b&gt;&lt;b&gt;WCF Service will return a JSON string to jquery ajax method.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You will need some jquery js files.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
jquery.js&lt;/div&gt;
&lt;div&gt;
jquery.ui.core.js&lt;/div&gt;
&lt;div&gt;
jquery-1.7.2.js&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;script &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;language&lt;/span&gt;=&lt;span style=&quot;color: blue;&quot;&gt;javascript&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;passParameterToService() {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt; //By this way you can declare your parameters...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;data= {};&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data.id = &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;1&lt;/span&gt;&quot;;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data.Name = &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;EmployeeName&lt;/span&gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;dataAsString = data;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ($.type(data) === &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;object&lt;/span&gt;&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataAsString = JSON.stringify(data);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataAsString = data;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;dataString = { Value: dataAsString };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dataString = { param: dataString };&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt; // This Method will call your ajax service with the parameters&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CallService(dataString&amp;nbsp;);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;CallService(data)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; $.ajax({&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;PUT&lt;/span&gt;&quot;,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: &quot;&lt;span style=&quot;color: blue;&quot;&gt;http://localhost:&amp;lt;PortNumber&amp;gt;/EndPointName/Test&lt;/span&gt;&quot;,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: data,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; contentType: &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;json&lt;/span&gt;&quot;,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataType: &quot;&lt;span style=&quot;color: #b45f06;&quot;&gt;application/json; charset=utf-8&lt;/span&gt;&quot;,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; success: function (msg) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;//On Successful service call&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sucessFunction(msg);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error: ServiceFailed// When Service call fails&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; });&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;ServiceFailed(result)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; alert(&#39;&lt;span style=&quot;color: #b45f06;&quot;&gt;Service call failed: \n Status :&lt;/span&gt; &#39; + result.status + &#39; &lt;span style=&quot;color: #b45f06;&quot;&gt;Status Text :&lt;/span&gt; &#39; + result.statusText);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;sucessFunction(msg) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt;// Here you will&amp;nbsp;receive&amp;nbsp;your JSON string.......&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color: #b45f06;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rajiv-srivastava.blogspot.com/feeds/4202651648368834367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/restful-wcf-service-with-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/4202651648368834367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8494313944502597205/posts/default/4202651648368834367'/><link rel='alternate' type='text/html' href='http://rajiv-srivastava.blogspot.com/2012/10/restful-wcf-service-with-jquery.html' title='Restful WCF service with Jquery'/><author><name>Rajiv Kumar Srivastava</name><uri>http://www.blogger.com/profile/11440422052942571637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIX32vBzNWRS6MV7bKQTmK4WC9GxjoHaGqGiuzb2fF_1Xu6nIrzaV50XA8eY9BGYArWLU-z_UBuHTPuLFV3-_m4QuzyvWYJj5vZQx-X68EAcppd509Ob2bUFVMMebPfBc_t-_kKV_Grk/s72-c/1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>