<?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>.Net &amp;&amp; Beyond</title>
	<atom:link href="http://blogs.microsoft.co.il/alon_nativ/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.microsoft.co.il/alon_nativ</link>
	<description>Taking about .NET and much more</description>
	<lastBuildDate>Tue, 14 Jan 2014 22:46:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.2</generator>
	<item>
		<title>Customize JQuery Autocomplete</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2012/06/10/customize-jquery-autocomplete/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2012/06/10/customize-jquery-autocomplete/#comments</comments>
		<pubDate>Sun, 10 Jun 2012 23:06:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=1116976</guid>
		<description><![CDATA[A few month ago I wrote a post about “Search Facebook Friends With Jquery Autocomplete”. The problem that after a while it become not relevant due to the changes in the jquery autocomplete API. Due to many requests that I got (in comments,emails, facebook, twitter) I decided to update it. So here we go&#8230; Before [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong id="internal-source-marker_0.6579433083534241" style="color: #000000; font-family: Times; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; font-weight: normal;"><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A few month ago I wrote a post about “</span><a href="http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/05/30/search-facebook-friends-with-jquery-autocomplete.aspx"><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Search Facebook Friends With Jquery Autocomplete</span></a><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">”. The problem that after a while it become not relevant due to the changes in the jquery autocomplete API. Due to many requests that I got (in comments,emails, facebook, twitter) I decided to update it. So here we go&#8230;</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Before I start I have to admit that I don’t like the new API it is too hacky to make a custom autocomplete and it is </span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">not documented!</span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Before we implements &#8220;Search Facebook Friends With jQuery&#8221; we need to look at the jQuery autocomplete source code, </span><a href="https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.autocomplete.js#L507"><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.autocomplete.js#L507</span></a><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. The method that render the UI for the autocomplete is called _renderItem</span></strong></p>
<p><strong id="internal-source-marker_0.6579433083534241" style="color: #000000; font-family: Times; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; font-weight: normal;"><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_renderItem</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">function</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">( ul, item ) {</span><br /><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="white-space: pre;"> </span><span style="white-space: pre;"> </span></span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> $( </span><span style="font-size: 12px; font-family: Verdana; color: #dd1144; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&#8220;&lt;li&gt;&#8221;</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> )</span><br /><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="white-space: pre;"> </span><span style="white-space: pre;"> </span><span style="white-space: pre;"> </span>.append( $( </span><span style="font-size: 12px; font-family: Verdana; color: #dd1144; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&#8220;&lt;a&gt;&#8221;</span><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ).text( item.label ) )</span><br /><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="white-space: pre;"> </span><span style="white-space: pre;"> </span><span style="white-space: pre;"> </span>.appendTo( ul );</span><br /><span style="font-size: 12px; font-family: Verdana; color: #333333; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="white-space: pre;"> </span>}</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ho snap there is a problem it is private&#8230; But don’t worry it seems that there is a “normal” way to override it (again not documented) </span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in order to override autocomplete internal methods you need to write the code:</span></strong></p>
<p><span id="internal-source-marker_0.6579433083534241" style="color: #000000; font-family: Times; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; font-weight: normal;"><br /><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 12px; font-family: Consolas; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">data</span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">( </span><span style="font-size: 12px; font-family: Consolas; color: #aa2222; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&#8220;autocomplete&#8221; </span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">).</span><span style="font-size: 12px; font-family: Consolas; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_renderItem </span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">= </span><span style="font-size: 12px; font-family: Consolas; color: #770088; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">function</span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">( </span><span style="font-size: 12px; font-family: Consolas; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ul</span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="font-size: 12px; font-family: Consolas; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">item </span><span style="font-size: 12px; font-family: Consolas; color: #666666; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) {//write your code here }</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">So now that we know what to do we can make our own facebook autocomplete</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*in my example the input textbox is </span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&lt;input id=&#8221;autocomplete-input&#8221; /&gt;</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">First we need to create an auto complete &#8211; you can find many examples of how to do it in the official jQuery Autocomplete site </span><a style="font-family: Times; font-size: medium; white-space: normal; font-weight: normal;" href="http://jqueryui.com/demos/autocomplete/"><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://jqueryui.com/demos/autocomplete/</span></a></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now we need to render the facebook friends URL </span><a style="font-family: Times; font-size: medium; white-space: normal; font-weight: normal;" href="https://graph.facebook.com/me/friends?access_token="><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://graph.facebook.com/me/friends?access_token=</span></a><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{YOUR_ACCESS_TOKEN}&amp;callback=?</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can read more about it here: </span><a style="font-family: Times; font-size: medium; white-space: normal; font-weight: normal;" href="http://graph.facebook.com/"><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://graph.facebook.com/</span></a><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (you will even get your access token there)</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">we almost done&#8230;  we need to override the </span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_renderItem</span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> method</span></span></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><br /></pre>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$("#autocomplete-input").data("autocomplete")._renderItem =  function( ul, item ) {</span><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    var image_url = "http://graph.facebook.com/" + item.value +"/picture";</span><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><br /></span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    return $( "&lt;li&gt;" )</span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.append($("&lt;img style='float:left'&gt;").attr('src',image_url))</span><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><br /></span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    .append( $( "&lt;a&gt;" ).text( item.label ) )</span><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><br /></span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    .appendTo( ul );</span><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><br /></span><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><br /><br /></span></pre>
<p><span id="internal-source-marker_0.6579433083534241" style="color: #000000; font-family: Times; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; font-weight: normal;"><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">we also need to make sure that we build the item that we get from facebook</span></span></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 715px; direction: ltr; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em;"><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 715px; direction: ltr; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em;"><span style="color: #606060; font-family: 'Courier New', courier, monospace; font-size: x-small;"><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">success: function( data ) {</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    res = $.map( data.data, function( item ) {</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    if (item.name.toLowerCase().indexOf(request.term.toLowerCase()) &gt;= 0){</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">       return {</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">          label: item.name,</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">          value: item.id</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">       }</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">    }</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">   });</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">  response(res);</span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><br /><span style="font-family: Arial; font-size: 15px; white-space: pre-wrap; color: #000000; line-height: normal;"> </span></span></pre>
<p></span></p>
<p><span id="internal-source-marker_0.6579433083534241" style="color: #000000; font-family: Times; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; font-weight: normal;"><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Here is a full example: (just add the jQuery , jQuery UI src file)</span></p>
<p><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><a href="https://gist.github.com/2907134">https://gist.github.com/2907134</a><br /></span></span><br /><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*Note that you can optimize this sample by using “remote with cache” </span><a style="font-family: Times; font-size: medium; white-space: normal; font-weight: normal;" href="http://jqueryui.com/demos/autocomplete/#remote-with-cache"><span style="font-size: 15px; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://jqueryui.com/demos/autocomplete/#remote-with-cache</span></a><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> or pre load the data</span></p>
<p><span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Good luck</span></p>
<p><span style="font-size: 13px; font-family: Tahoma; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Keep Writing, Compiling, and Debugging</span><br /><span style="font-size: 13px; font-family: Tahoma; color: #000000; background-color: #ffffff; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Alon Nativ</span></span></p>
<div>
<a href="https://twitter.com/anativ" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @anativ</a>
</div>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2012/06/10/customize-jquery-autocomplete.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2012/06/10/customize-jquery-autocomplete/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails and Heroku &#8211; Love from first &#034;site&#034;</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2012/04/02/ruby-on-rails-and-heroku-love-from-first-quotsitequot/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2012/04/02/ruby-on-rails-and-heroku-love-from-first-quotsitequot/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 23:34:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Heroku]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=1052674</guid>
		<description><![CDATA[Ruby on Rails and Heroku is a great match! Heroku is a great platform for any startup that wants to develop fast and without spending a lot money Heroku is a platform that allows you to think about servers as a service. I am using Heroku with Rails (and Node.js) for a long time. But [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ruby on Rails and Heroku is a great match! Heroku is a great platform for any startup that wants to develop fast and without spending a lot money</p>
<p><a href="http://www.heroku.com/">Heroku</a> is a platform that allows you to think about servers as a service.</p>
<p>I am using Heroku with Rails (and Node.js) for a long time. But in my current startup the only servers that we have (so far) are on Heroku. It is much more easy that you don&#8217;t need to think about your servers. I got much more time to handle the important stuff. It is so easy and simple that each developer can create his own server, qa servers, staging server and the production server</p>
<p>Heroku currently supports: Ruby, Node.js, Clojure, Java, Python and Scala. If you are looking for .NET solution you should look at  <a href="https://appharbor.com/">AppHarbor</a> &#8211; it is the same solution for .NET applications, I personally didn&#8217;t use it &#8211; so use it on you own risk <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Some few great thing about heroku is:</p>
<p>1. It is free! (if you don&#8217;t expect a lot of traffic)</p>
<p>2. it is easy. All you need to do in order to deploy to a server is:</p>
<ul>
<li>$ heroku create</li>
<li>$ git push heroku master</li>
</ul>
<p>3. It is fun! every time that you create a server you get a funny name for example:</p>
<ul>
<li>afternoon-waterfall</li>
<li>deep-mist</li>
<li>empty-mist</li>
<li>empty-sunrise</li>
<li>furious-fog</li>
<li>gentle-leaf</li>
<li>morning-planet</li>
</ul>
<p>and much more names funny names, yes you can change it by running &#8220;heroku rename&#8221;</p>
<p> </p>
<p>Even if you don&#8217;t need heroku now you should play a bit with it</p>
<p style="color: #000000; font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">Keep Writing, Compiling, and Debugging</p>
<p style="color: #000000; font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">Alon Nativ</p>
<div>
<a href="https://twitter.com/anativ" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @anativ</a>
</div>
<div style="margin-bottom: 12px;"></div>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2012/04/02/ruby-on-rails-and-heroku-love-from-first-site.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2012/04/02/ruby-on-rails-and-heroku-love-from-first-quotsitequot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>End of an Era</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2012/03/06/end-of-an-era/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2012/03/06/end-of-an-era/#respond</comments>
		<pubDate>Tue, 06 Mar 2012 11:39:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[OFFTOPIC]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=1027740</guid>
		<description><![CDATA[Well this is an end of an era for me&#8230; I left Conduit and starting my own startup. There are few major changes in this event 1. I am starting my own company 🙂 2. I decided to buy a mac. Yes yes I know that you can&#8217;t develop with .Net on a mac. After [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="font-size: 13px;">Well this is an end of an era for me&#8230;</p>
<p style="font-size: 13px;">I left Conduit and starting my own startup. There are few major changes in this event</p>
<p style="font-size: 13px;">1. I am starting my own company <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p style="font-size: 13px;">2. I decided to buy a mac.</p>
<p style="font-size: 13px;">Yes yes I know that you can&#8217;t develop with .Net on a mac. After a long journey with .NET (since .NET 1.1) I have decided to leave it and write with Ruby on Rails. In the past few month I was using both .NET &amp; Ruby and even though I am (or was) a big .NET fan I must say that my hart goes with Ruby. When I started writing in Ruby i felt that someone opened my eyes and told me the king in naked… I started to understand that in .NET I am wasting to much time on writing infrastructure for my project instead of writing the real business logic. My code becomes much shorter, easier to read, with less bugs and was written faster.</p>
<p style="font-size: 13px;">Good bye .NET it was fun…</p>
<p style="font-size: 13px;">Hello Ruby!</p>
<p style="font-size: 13px;"> </p>
<div>
<a href="https://twitter.com/anativ" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @anativ</a>
</div>
<div style="margin-bottom: 12px;"></div>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2012/03/06/end-of-an-era.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
<p style="font-size: 13px;">BTW: here is my new mac (another good reason to abandoned .NET)</p>
<p><img title="IMG_0543.JPG" src="http://blogs.microsoft.co.il/blogs/alon_nativ/IMG_0543.JPG" border="0" alt="IMG 0543" width="480" height="360" /></p>
<p> </p>
<p> </p>
<p> </p>
<p style="color: #000000; font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">Keep Writing, Compiling, and Debugging</p>
<p style="color: #000000; font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">Alon Nativ</p>
<p style="color: #000000; font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2012/03/06/end-of-an-era/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Node.js Socket.IO and the Real-Time Web</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2012/02/02/nodejs-socketio-and-the-real-time-web/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2012/02/02/nodejs-socketio-and-the-real-time-web/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 20:14:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[OFFTOPIC]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Socket.IO]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=1005123</guid>
		<description><![CDATA[Today we had our 1st developers meet-up @conduit. I made a session on node.js Socket.IO and the Real-time web. You can find the slides here: http://www.slideshare.net/alonnativ/nodejs-socketio It was fun! &#160; Keep Writing, Compiling, and Debugging Alon Nativ Follow @anativ]]></description>
				<content:encoded><![CDATA[<p>Today we had our 1st developers meet-up @conduit.</p>
<p>I made a session on node.js Socket.IO and the Real-time web. You can find the slides here: <a href="http://www.slideshare.net/alonnativ/nodejs-socketio">http://www.slideshare.net/alonnativ/nodejs-socketio</a></p>
<p><img src="http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc7/418648_10150653005966913_634431912_11097465_1238944841_n.jpg" width="348" height="260" /></p>
<p>It was fun!</p>
<p>&#160;</p>
<p>Keep Writing, Compiling, and Debugging</p>
<p>Alon Nativ</p>
<div>
<a href="https://twitter.com/anativ" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @anativ</a>
</div>
<div style="margin-bottom: 12px;"></div>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2012/02/02/node-js-socket-io-and-the-real-time-web.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2012/02/02/nodejs-socketio-and-the-real-time-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enable cross origin request with ASP.NET MVC</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/10/05/enable-cross-origin-request-with-aspnet-mvc/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/10/05/enable-cross-origin-request-with-aspnet-mvc/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 02:08:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=910798</guid>
		<description><![CDATA[As you know you can’t make an Ajax cross domain request. The browser block this kind of requests. To enable Cross-Origin Requests (CORS) you need to add some headers to the server response: “Access-Control-Allow-Origin” and “Access-Control-Allow-Methods”. So I made a MVC filter that will allow cross domain calls: public class AllowCrossDomain : ActionFilterAttribute { public [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As you know you can’t make an Ajax cross domain request. The browser block this kind of requests. To enable Cross-Origin Requests (CORS) you need to add some headers to the server response: “Access-Control-Allow-Origin” and “Access-Control-Allow-Methods”.</p>
<p>So I made a MVC filter that will allow cross domain calls:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> AllowCrossDomain : ActionFilterAttribute</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> AllDomains = <span style="color: #006080">&quot;*&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">private</span> <span style="color: #0000ff">readonly</span> <span style="color: #0000ff">string</span>[] _allowMethods;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span> _allowOrigin;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> AllowCrossDomain()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        : <span style="color: #0000ff">this</span>(<span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> AllowCrossDomain(<span style="color: #0000ff">string</span> allowOrigin, <span style="color: #0000ff">params</span> <span style="color: #0000ff">string</span>[] allowMethods)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        _allowMethods = allowMethods;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        _allowOrigin = allowOrigin;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">if</span> (<span style="color: #0000ff">string</span>.IsNullOrWhiteSpace(_allowOrigin))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            _allowOrigin = AllDomains;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">if</span> (_allowMethods == <span style="color: #0000ff">null</span> || _allowMethods.Length == 0)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            _allowMethods = <span style="color: #0000ff">new</span>[] { <span style="color: #006080">&quot;GET&quot;</span> };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> OnActionExecuting(ActionExecutingContext filterContext)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        filterContext.HttpContext.Response.Headers.Add(<span style="color: #006080">&quot;Access-Control-Allow-Origin&quot;</span>, _allowOrigin);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        filterContext.HttpContext.Response.Headers.Add(<span style="color: #006080">&quot;Access-Control-Allow-Methods&quot;</span>, <span style="color: #0000ff">string</span>.Join(<span style="color: #006080">&quot;, &quot;</span>, _allowMethods));</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        filterContext.HttpContext.Response.Headers.Add(<span style="color: #006080">&quot;Access-Control-Max-Age&quot;</span>, <span style="color: #006080">&quot;86400&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></div>
</div>
<p>To use it just put it on a method on controller:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[AllowCrossDomain]</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> ActionResult Index()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">return</span> Json(<span style="color: #0000ff">new</span> {sample=<span style="color: #006080">&quot;a sample data&quot;</span>,crossDomain=<span style="color: #006080">&quot;you can read it from cross domain&quot;</span>})</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p>Simple…</p>
<p>A few things before you try this:</p>
<p>1. “Cassini” doesn’t support this kind of headers you will need to run it on IIS \ IIS Express</p>
<p>2. CROS are supported only by modern browsers FF 3.6+ all chrome browsers, modern smart phones… </p>
<p>3. In order to enable it on IE you need to change the security settings:</p>
<p><img src="http://www.webdavsystem.com/images/ajax/EnableCrossDomainRequestsIE.png" width="566" height="790" /></p>
<p>&#160;</p>
<p>you can read more about CROS here: <a href="http://www.w3.org/TR/cors/">http://www.w3.org/TR/cors/</a></p>
<p>&#160;</p>
<p>Keep Writing, Compiling, and Debugging</p>
<p>Alon Nativ</p>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/10/05/enable-cross-origin-request-with-asp-net-mvc.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/10/05/enable-cross-origin-request-with-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Get Detailed Notification From Facebook API</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/08/08/get-detailed-notification-from-facebook-api/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/08/08/get-detailed-notification-from-facebook-api/#respond</comments>
		<pubDate>Mon, 08 Aug 2011 00:59:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=881268</guid>
		<description><![CDATA[Recently I was asked question how to get the image or the comment when using Facebook FQL API to get notification. http://developers.facebook.com/docs/reference/fql/notification/ It is very easy to make an application that will show the basic notification like that looks like: “David has comment on your link” “James liked your photo” You can see more samples [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Recently I was asked question how to get the image or the comment when using Facebook FQL API to get notification. <a href="http://developers.facebook.com/docs/reference/fql/notification/">http://developers.facebook.com/docs/reference/fql/notification/</a></p>
<p>It is very easy to make an application that will show the basic notification like that looks like:</p>
<p>“David has comment on your link”</p>
<p>“James liked your photo”</p>
<p>You can see more samples at this link: <a href="http://www.facebook.com/notifications.php">http://www.facebook.com/notifications.php</a></p>
<p>Well there is no documentation of how to do it (and there is not even a clean way to do it) there is no column that points the the original link\image\comment.</p>
<p>So… do we give up? of course not!</p>
<p>If we will look at the format of the “herf” we will see that there is a param called “story_fbid” (sometimes it is called “fbid” depends on the type of the notification)</p>
<p><a title="http://www.facebook.com/permalink.php?story_fbid=178287412229452&amp;amp;id=100001445838266\" href="http://www.facebook.com/permalink.php?story_fbid=178287412229452&amp;id=100001445838266\">http://www.facebook.com/permalink.php?story_fbid=<font style="background-color: #ffff00">178287412229452</font>&amp;id=100001445838266\</a></p>
<p>Now all you need to do is take the id and call the graph API <a title="https://graph.facebook.com/me/friends?access_token=" href="https://graph.facebook.com/{ID}?access_token=XZY">https://graph.facebook.com/<font style="background-color: #ffff00">{ID}</font>?access_token=XZY</a> for more information about the graph API visit (<a href="http://developers.facebook.com/docs/reference/api/">http://developers.facebook.com/docs/reference/api/</a>)</p>
<p>That’s it.</p>
<p>Now you can improve your Facebook notification</p>
<p>&#160;</p>
<p>Keep Writing, Compiling, and Debugging</p>
<p>Alon Nativ</p>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/08/08/get-detailed-notification-from-facebook-api.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/08/08/get-detailed-notification-from-facebook-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC ImagePixel ActionResult</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/07/10/aspnet-mvc-imagepixel-actionresult/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/07/10/aspnet-mvc-imagepixel-actionresult/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 20:36:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=855108</guid>
		<description><![CDATA[Just wanted to create a web logger in MVC. The idea is the same as Google analytics that a client will send data from the &#8220;client side&#8221; to the server. The server will save the data and return “Image Pixel” just like any other normal web logger. In order to do that I have created [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Just wanted to create a web logger in MVC. The idea is the same as Google analytics that a client will send data from the &#8220;client side&#8221; to the server. The server will save the data and return “Image Pixel” just like any other normal web logger. In order to do that I have created an ImagePixel ActionResult.</p>
<p>The server logger method will look something like that:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> ActionResult Logger(<span style="color: #0000ff">string</span> trackingData)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    Log(trackingData);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> ImagePixelResult();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p>The ImagePixelResult is defined like this:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ImagePixelResult : ActionResult</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> <span style="color: #0000ff">byte</span>[] Imgbytes = Convert.FromBase64String(<span style="color: #006080">&quot;R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> ExecuteResult(ControllerContext context)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            HttpResponseBase httpResponse = context.HttpContext.Response; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.ContentType = <span style="color: #006080">&quot;image/gif&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.AppendHeader(<span style="color: #006080">&quot;Content-Length&quot;</span>, Imgbytes.Length.ToString());</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.Cache.SetLastModified(DateTime.Now);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.Cache.SetCacheability(HttpCacheability.NoCache);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.Expires = -1500;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.Cache.SetNoStore();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.ExpiresAbsolute = DateTime.Now.AddYears(-1);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            httpResponse.BinaryWrite(Imgbytes);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></div>
</div>
<p>Clean and simple <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&#160;</p>
<p>Keep Writing, Compiling, and Debugging.</p>
<p>Alon Nativ</p>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/07/10/asp-net-mvc-imagepixel-actionresult.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/07/10/aspnet-mvc-imagepixel-actionresult/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google +1</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/06/02/google-1/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/06/02/google-1/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 11:05:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[OFFTOPIC]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=839497</guid>
		<description><![CDATA[Just added Google +1 to my blog. The +1 is the Google &#8220;like&#8221; button. It should help Google to find what kind of pages people are interested in and improve the search experience. &#160; In order the add the +1 button go to the documentation add to your page: &#60;!-- Place this tag in your [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Just added Google +1 to my blog.</p>
<p>The +1 is the Google &#8220;like&#8221; button. It should help Google to find what kind of pages people are interested in and improve the search experience.</p>
<pre>&#160;</pre>
<div class="g-plusone" data-count="true" data-size="standard"></div>
<p>In order the add the +1 button go to the <a href="http://www.google.com/webmasters/+1/button/#utm_source=webmasters&amp;utm_medium=email&amp;utm_campaign=waitlist">documentation</a> add to your page: </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">&lt;!-- Place <span style="color: #0000ff">this</span> tag <span style="color: #0000ff">in</span> your head or just before your close body tag --&gt;<br />&lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span> src=<span style="color: #006080">&quot;http://apis.google.com/js/plusone.js&quot;</span>&gt;&lt;/script&gt;<br /><br />&lt;!-- Place <span style="color: #0000ff">this</span> tag where you want the +1 button to render --&gt;<br />&lt;g:plusone&gt;&lt;/g:plusone&gt;</pre>
<p></div>
<p>In some pages (this blog platform for example) you can’t add this code so you must use HTML5 style (I think it is better)</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">&lt;div <span style="color: #0000ff">class</span>=<span style="color: #006080">&quot;g-plusone&quot;</span> data-size=<span style="color: #006080">&quot;standard&quot;</span> data-count=<span style="color: #006080">&quot;true&quot;</span>&gt;&lt;/div&gt;</pre>
<p></div>
<p>You can read more on how to do it in <a href="http://code.google.com/apis/+1button/">here</a></p>
<p>So +1 my blog</p>
</p>
<p>Keep Writing, Compiling, and Debugging</p>
<p>Alon Nativ</p>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/06/02/google-1.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/06/02/google-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Facebook Friends With Jquery Autocomplete</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/05/30/search-facebook-friends-with-jquery-autocomplete/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/05/30/search-facebook-friends-with-jquery-autocomplete/#comments</comments>
		<pubDate>Mon, 30 May 2011 23:55:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=838827</guid>
		<description><![CDATA[Just made a small autocomplete textbox that search a user friends from Facebook. it is a pretty simple implementation that allow the user to search for his friends. In order to use it you will need to get a valid access_token from Facebook (but you can read more in how to use the Facebook graph [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Just made a small autocomplete textbox that search a user friends from Facebook.</p>
<p>it is a pretty simple implementation that allow the user to search for his friends. In order to use it you will need to get a valid access_token from Facebook (but you can read more in how to use the Facebook graph API at <a href="http://developers.facebook.com/docs/reference/api/">http://developers.facebook.com/docs/reference/api/</a> – or get a sample one).</p>
<p>There are a few tricks in the implantation</p>
<ul>
<li>Use dataType: ‘jsonp’ – undocumented option that allow us to use jsonp instead of json </li>
<li>Use Facebook API to get the user image: <a href="http://graph.facebook.com/{ID}/picture?type=square">http://graph.facebook.com/{ID}/picture?type=square</a> for example <a href="http://graph.facebook.com/4/picture?type=square">http://graph.facebook.com/4/picture?type=square</a> </li>
<li>Use the formatItem that will return HTML instead of a text. </li>
</ul>
<p>&#160;</p>
<p>So here is the code</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> &lt;script src=<span style="color: #006080">&quot;../../Scripts/jquery-1.5.1.min.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> &lt;script src=<span style="color: #006080">&quot;../../Scripts/jquery-ui.min.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> &lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span> src=<span style="color: #006080">&quot;../../Scripts/jquery.autocomplete.min.js&quot;</span>&gt;&lt;/script&gt; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> &lt;script&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #008000">//Get the user image from the user id</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     <span style="color: #0000ff">function</span> getImage(id) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         <span style="color: #0000ff">return</span> <span style="color: #006080">&quot;http://graph.facebook.com/&quot;</span> + id + <span style="color: #006080">&quot;/picture?type=square&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>     <span style="color: #0000ff">var</span> accessToken = <span style="color: #006080">&quot;PUT A VALID ACCESS TOKEN HERE INORDER TO MAKE IT WORK&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>     $(document).ready(<span style="color: #0000ff">function</span> () {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>         $(<span style="color: #006080">&quot;#example&quot;</span>).autocomplete(<span style="color: #006080">&quot;https://graph.facebook.com/me/friends?access_token=&quot;</span> + accessToken + <span style="color: #006080">&quot;&amp;callback=?&quot;</span>, {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>         </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>             width: 250,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>             height: 400,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>             max: 8,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>             dataType: <span style="color: #006080">'jsonp'</span>,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>             cacheLength: 10,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>             minChars: 1,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>             parse: <span style="color: #0000ff">function</span> (data) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>                 <span style="color: #0000ff">var</span> rows = <span style="color: #0000ff">new</span> Array();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>                 data = data.data;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>                 <span style="color: #0000ff">for</span> (<span style="color: #0000ff">var</span> i = 0; i &lt; data.length; i++) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>                     rows[i] = { data: data[i], value: data[i].name, result: data[i].name };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>                 }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>                 <span style="color: #0000ff">return</span> rows;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>             },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>             formatItem: <span style="color: #0000ff">function</span> (data, i, n, value, text, a, b, c, d) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>                 <span style="color: #0000ff">var</span> x = getImage(data.id);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>                 <span style="color: #0000ff">return</span> <span style="color: #006080">&quot;&lt;div class='test2'&gt;&lt;img class='test' width='32px' height='32px' src='&quot;</span> + x + <span style="color: #006080">&quot;'&gt;&lt;/img&gt;&lt;span&gt;&quot;</span> + data.name + <span style="color: #006080">&quot;&lt;/span&gt;&lt;/div&gt;&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>             },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>             </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>           ).result(<span style="color: #0000ff">function</span> (evnet, item) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>               alert(item.id);       </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>           });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>     });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span> &lt;/script&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span> Write a friend name</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span> &lt;input id=<span style="color: #006080">&quot;example&quot;</span> /&gt;</pre>
<p><!--CRLF--></div>
</div>
<p>The final result will look something like that:</p>
<p><a href="http://blogs.microsoft.co.il/blogs/alon_nativ/image_6FDD39CB.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.microsoft.co.il/blogs/alon_nativ/image_thumb_25FEB21B.png" width="384" height="213" /></a></p>
<p>All you need to do now is change the style so it will fit in your site</p>
<p>You can read more about jquery autocomplete plugin here: <a href="http://docs.jquery.com/Plugins/Autocomplete/autocomplete">http://docs.jquery.com/Plugins/Autocomplete/autocomplete</a>&#160;</p>
<p>&#160;</p>
<p>Update: There is an update to this post <a href="http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2012/06/10/customize-jquery-autocomplete.aspx">here</a></p>
<p>Keep Writing, Compiling, and Debugging</p>
<p>Alon Nativ</p>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http://blogs.microsoft.co.il/blogs/alon_nativ/archive/2011/05/30/search-facebook-friends-with-jquery-autocomplete.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/05/30/search-facebook-friends-with-jquery-autocomplete/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>The King is dead. Long live the King</title>
		<link>http://blogs.microsoft.co.il/alon_nativ/2011/05/16/the-king-is-dead-long-live-the-king/</link>
		<comments>http://blogs.microsoft.co.il/alon_nativ/2011/05/16/the-king-is-dead-long-live-the-king/#comments</comments>
		<pubDate>Mon, 16 May 2011 18:34:00 +0000</pubDate>
		<dc:creator><![CDATA[Alon Nativ]]></dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[OFFTOPIC]]></category>
		<category><![CDATA[Reflection]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.microsoft.co.il/?p=835696</guid>
		<description><![CDATA[A few weeks ago redgate announced that the lovely .NET reflector&#160; is going to cost money, that was a very sad news for every .NET developer out there. But the good news are that a few days after JetBrains announced that they are releasing there own reflector called dotPeek. I personally hate the name but [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A few weeks ago redgate announced that the lovely <a href="http://reflector.red-gate.com">.NET reflector</a>&#160; is going to cost money, that was a very sad news for every .NET developer out there.</p>
<p>But the good news are that a few days after JetBrains announced that they are releasing there own reflector called <a href="http://www.jetbrains.com/decompiler/">dotPeek</a>. I personally hate the name but It is a great tool!</p>
<p>Much faster great UI and the best thing it has all of the ReSharper shortcuts!</p>
<p>So even if you decided to pay for the .NET reflector I think that you should throw it away and start using dotPeek</p>
<p>The king (.NET reflector) is dead. Long live the King (dotPeek)!</p>
<p>&#160;</p>
<p>Keep Writing, Compiling, and Debugging.</p>
<p>Alon Nativ</p>
<p>&#160;</p>
<p><div class="g-plusone" data-size="standard" data-count="true"></div>
</p>
<p><iframe style="border-bottom: medium none; border-left: medium none; width: 450px; height: 80px; overflow: hidden; border-top: medium none; border-right: medium none" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblogs.microsoft.co.il%2Fblogs%2Falon_nativ%2Farchive%2F2011%2F05%2F16%2Fthe-king-is-dead-long-live-the-king.aspx&amp;send=true&amp;layout=standard&amp;ref=like&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" frameborder="0" allowtransparency="allowtransparency" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.microsoft.co.il/alon_nativ/2011/05/16/the-king-is-dead-long-live-the-king/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
