<?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/"
	xmlns:georss="http://www.georss.org/georss">

<channel>
	<title>www.netsi.dk &#187; javascript</title>
	<atom:link href="http://www.netsi.dk/wordpress/index.php" rel="self" type="application/rss+xml" />
	<link>http://www.netsi.dk/wordpress</link>
	<description>&#34;The internet is just a layer on the real world&#34; (don&#039;t forget that!)</description>
	<lastBuildDate>Fri, 27 Jan 2012 15:57:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel="next" href="http://www.netsi.dk/wordpress/index.php?page=2" />

		<item>
		<title>Encode URL in XSLT</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 11:48:05 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[encodeURI]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/</guid>
		<description><![CDATA[If you need to URL encode something in XSLT, you can use javascript serverside – not perfect, but it gets the job done. Here is the javascript and below you can find link to a simpel XSLT which has the script implemented. 1: &#60;script language=&#34;javascript&#34; xmlns=&#34;urn:schemas-microsoft-com:xslt&#34; implements-prefix=&#34;js&#34;&#62; 2: &#60;![CDATA[ 3: // This will return a [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to URL encode something in XSLT, you can use <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> serverside – not perfect, but it gets the job done. Here is the <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> and below you can find link to a simpel XSLT which has the script implemented.</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>  &lt;script language=<span class="str">&quot;javascript&quot;</span> xmlns=<span class="str">&quot;urn:schemas-microsoft-com:xslt&quot;</span> implements-prefix=<span class="str">&quot;js&quot;</span>&gt;</pre>
<pre><span class="lnum">   2:  </span>    &lt;![CDATA[ </pre>
<pre class="alt"><span class="lnum">   3:  </span>    <span class="rem">// This will return a URI encoded string</span></pre>
<pre><span class="lnum">   4:  </span>    <span class="kwrd">function</span> encodeURL(sUrl) {</pre>
<pre class="alt"><span class="lnum">   5:  </span>      sUrl.MoveNext();</pre>
<pre><span class="lnum">   6:  </span>      sUrl = sUrl.Current.Value;</pre>
<pre class="alt"><span class="lnum">   7:  </span>      <span class="kwrd">return</span> <a href="http://www.netsi.dk/wordpress/index.php/tag/encodeuri/" class="st_tag internal_tag" rel="tag" title="Posts tagged with encodeURI">encodeURI</a>(sUrl);</pre>
<pre><span class="lnum">   8:  </span>    }</pre>
<pre class="alt"><span class="lnum">   9:  </span>    ]]&gt;</pre>
<pre><span class="lnum">  10:  </span>  &lt;/script&gt;</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .<a href="http://www.netsi.dk/wordpress/index.php/tag/html/" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">html</a> { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Find example XSLT here: <a title="http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt" href="http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt">http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2011%2F02%2F02%2Fencode-url-in-xslt%2F&amp;title=Encode%20URL%20in%20XSLT" id="wpa2a_2"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New HTML5 testing section on my website</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/01/31/new-html5-testing-section-on-my-website/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/01/31/new-html5-testing-section-on-my-website/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 22:51:43 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[explorercanvas]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/01/31/new-html5-testing-section-on-my-website/</guid>
		<description><![CDATA[I started up a new HTML5 testing area on my website today. It will be an area where I will show/test some features of HTML5. I will try to cross post a small post here on my blog, allowing you to keep track from here when I post new demoes. Also you are welcome to [...]]]></description>
			<content:encoded><![CDATA[<p>I started up a new <a href="http://www.netsi.dk/wordpress/index.php/tag/html5/" class="st_tag internal_tag" rel="tag" title="Posts tagged with HTML5">HTML5</a> testing area on my website <abbr class="datetime" title="2011-01-31">today</abbr>. It will be an area where I will show/test some features of <a href="http://www.netsi.dk/wordpress/index.php/tag/html/" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">HTML</a>5. I will try to cross post a small post here on my blog, allowing you to keep track from here when I post new demoes. Also you are welcome to post your comments here on my blog for each example I upload.</p>
<h3><a title="The first one: a simpel animated pie-countdown" href="http://www.netsi.dk/html5/pie-like%20countdown.html">The first one: a simpel animated pie-countdown</a></h3>
<p>&#160;</p>
<h3><a title="Go and see the simpel HTML5 based animated pie-countdown" href="http://www.netsi.dk/html5/pie-like%20countdown.html"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="A simpel HTML5 based animated pie-countdown" border="0" alt="A simpel HTML5 based animated pie-countdown" src="http://www.netsi.dk/wordpress/wp-content/uploads/2011/01/Aviary-netsi-dk-Picture-1.png" width="480" height="302" /></a></h3>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2011%2F01%2F31%2Fnew-html5-testing-section-on-my-website%2F&amp;title=New%20HTML5%20testing%20section%20on%20my%20website" id="wpa2a_4"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2011/01/31/new-html5-testing-section-on-my-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improvements in Microsoft Visual Studio 2010, from a frontend webdevelopers point of view, part 1: javascript</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 21:48:39 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[intellisense]]></category>
		<category><![CDATA[Microsoft Visual studio 2010]]></category>
		<category><![CDATA[xml commenta]]></category>
		<category><![CDATA[xml documentation]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/</guid>
		<description><![CDATA[Sometimes I have wondered just what the h**l they were thinking over at Microsoft: their flagship development tool just didn’t perform and deliver what you would expect from a tool of that caliber. That was before the Microsoft Visual Studio 2010 (VS 2010)! I will try to write about features in VS 2010 which makes [...]]]></description>
			<content:encoded><![CDATA[<p><em>Sometimes I have wondered just what the h**l they were thinking over at Microsoft: their flagship development tool just didn’t perform and deliver what you would expect from a tool of that caliber. That was before the <a href="http://www.netsi.dk/wordpress/index.php/tag/microsoft-visual-studio-2010/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft Visual studio 2010">Microsoft Visual Studio 2010</a> (VS 2010)! I will try to write about features in VS 2010 which makes me happy as a frontend web developer, hoping that you will gain something from it – and please do comment and share your experiences.</em></p>
<h1>The background: What I missed…</h1>
<p>I have during my 15 years career as web developer tried various development tools, and have touched the “backend” development side of web applications also. It seems that many rich development tools focus on the heavier backend development part of web application development with things like <a href="http://www.netsi.dk/wordpress/index.php/tag/intellisense/" class="st_tag internal_tag" rel="tag" title="Posts tagged with intellisense">intellisense</a>, snippets and so on. I have often wondered: Why should it be so difficult and not possible – especially in VS – to automate things, processes which is done many times every day? Rich development tools RDTs should support the “web craftsmen” trying to produce quality work. In real life “real” tools for craftsmen like a carpenter have evolved. Quality tools make the fundament for quality work! Anyway, we might just have got a piece of quality tool in VS 2010!</p>
<h2>The new features &#8211; <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a></h2>
<p>In this part I focus on javascript in VS 2010.</p>
<h3>Javascript intellicence</h3>
<p><strong><a href="http://www.netsi.dk/wordpress/index.php/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a> embedded from local “standard” API javascript file.</strong> </p>
<p>It is near perfect now! The intellisense engine in VS 2010 seems to “think” nearly perfect. Say you want to use jQuery. If you include your jQuery API using a local version, you <em>will</em> get <strong>basic</strong> intellisense – that is objects inside the jQuery API will appear as you start typing. You will get <em>relevant</em> methods shown together with basic information about which parameters you can use. Okay, but it gets better!<br />
<h4>Microsoft minimised version of jQuery still has <a href="http://www.netsi.dk/wordpress/index.php/tag/intellisence/" class="st_tag internal_tag" rel="tag" title="Posts tagged with intellisence">intellisence</a></h4>
</p>
<p>jQuery embedded from Microsoft at: <a title="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" href="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" target="_blank">http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js</a> <br />Using the MS CDN to get even a <strong>minified version</strong> of jQuery, you <strong>still</strong> get extensive intellisence!<a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image9.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="absMiddle" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb9.png" width="640" height="79"/></a> </p>
<blockquote><p>Note: <br />After you have added any external script file you can <em>update the javascript intellisense</em> using <code>[Shift]+[Ctrl]+J</code>. For big APIs like jQuery this might take perhaps 20 seconds.</p>
</p>
</blockquote>
<h4>jQuery plug-ins handled as well in intelisence</h4>
<p>Extra jQuery plug-ins added will also get intellisense, as expected, but also at the correct place <br />below you can see that I have added a script reference to the <a title="jQuery Cycle plug-in homepage" href="http://jquery.malsup.com/cycle/" target="_blank">jQuery Cycle plug-in</a> for jQuery. The “cycle” method now exists after I have used a jQuery selector $(‘#test’). The description of the method “cycle” however is not very useful – but that is because that the jquery.cycle.all.min.js file <strong>does not contain JavaScript <a href="http://www.netsi.dk/wordpress/index.php/tag/documentation/" class="st_tag internal_tag" rel="tag" title="Posts tagged with documentation">documentation</a></strong> (more about that later). </p>
<p>If you think about it – VS 2010 is quit smart! It scans the cycle plug-in and sees that it <strong>extends</strong> the jQuery API. That is how it can figure out – I guess – that the cycle method fits in as a method on a found elements of the “$” (or jQuery) method. Nice feature! </p>
<p>&nbsp; </p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image10.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The intellisence works perfect" border="0" alt="The intellisence works perfect" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb10.png" width="554" height="315"/></a> </p>
<h4>Dropdown filelist simplified</h4>
<p>Automatic dropdown file list when adding <a href="http://www.netsi.dk/wordpress/index.php/tag/html/" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">HTML</a> code like “script”. Previously you had to click the “Pick URL…” and then point to the file which you wanted to use in your <a href="http://www.netsi.dk/wordpress/index.php/tag/html/" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">HTML</a> document. Now you simply click on the file, if it is located at the same place as the current document. Nice. </p>
<p>&nbsp; </p>
<p>”<a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image11.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Dropdown filelist simplified" border="0" alt="Dropdown filelist simplified" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb11.png" width="566" height="214"/></a></p>
<h4>Snippets – finally!!</h4>
<p>I have written about snippets in Visual Studio in a previous post: <a title="Find Visual Studio Snippets ready for download on my DropBox folder" href="http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/" target="_blank">Find Visual Studio Snippets ready for download on my DropBox folder</a>, but it is first in VS 2010 that it is actually possible to execute snippets in HTML mode! (Why, why, why?). Anyway you can now! And VS 2010 comes with a few snippets installed. </p>
<p><strong>Snippet types “Surround with” and “Insert snippet” </strong><b><br /></b>If you do not know how to activate them try the “<em>surround with snippet</em>” by pressing <code>[Ctrl]-K, [Ctrl]-S</code>. By doing that you get the chance to automate things like creating a JavaScript function using just two keyboard clicks and a mouse click. The Insert snippet can be archived using <code>[Ctrl]-K, [Ctrl]-X</code>. And remember: You can always create your own! </p>
</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image12.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Using the surround with snippet" border="0" alt="Using the surround with snippet" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb12.png" width="547" height="262"/></a> </p>
<p>Just discovered that in fact Microsoft has not made it possibel to use snippets within CSS… Why, why, why???</p>
<h4>Intellisence will execute your code dynamically to give better suggestions</h4>
<p>Say you define a string “effect” and assign it a <em>string</em> value. This will make VS 2010 execute the assignment and then “guess” that your variable is of the type String. So at a late point in your code you try to use the variable, <strong>the suggestions given by intellisense</strong> will be <strong>relevant</strong> to that type (string). Look at the example below. To the left a variable “effect” and to the right an “int”, the suggestions are not the same. Smart! and you can do some pretty nice things when your code is dynamically executed – try visiting the <a title="JavaScript Intellisense Improvements with VS 2010 - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2010/04/08/javascript-intellisense-improvements-with-vs-2010.aspx" target="_blank">JavaScript Intellisense Improvements with VS 2010 &#8211; on ScottGu&#8217;s Blog</a> and have a look at those examples.  </p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image13.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Intelligence sugestions are related to the type of your variable..." border="0" alt="Intelligence sugestions are related to the type of your variable..." src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb13.png" width="640" height="212"/></a></p>
<h4>Your own intellisence using XML comments! </h4>
<p>Now there is no excuse why you do not document your JavaScript code! VS 2010 offers <strong>easy</strong> documentation using <strong>snippets and XML comments!</strong> It is so easy, simply press <code>[Ctrl]+K, [Ctrl]+X</code>, choose “XML Comments” and what type of comment you want to insert. After having done and (of cause) filling out the marked fields, <strong>your</strong> code will be providing <strong>intellisense</strong> and <strong>suggestions</strong> when other people use it! <strong>Cool!</strong> </p>
<p>You can see below a simple function called “myhide”, The 3 lines below the function have been inserted using the above mentioned XML comments snippet. I defined a summary, a return definition and a param description. Voila! My function now has intellisense and build in help – which will without doubt be useful for me and others at a later state. You can make this part quit advanced with references to documentation files, assemblies and more.  </p>
</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image14.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Here goes your excuse for not documenting your javascript code anymore! XML Comments in javascript." border="0" alt="Here goes your excuse for not documenting your javascript code anymore! XML Comments in javascript." src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb14.png" width="640" height="351"/></a> </p>
<p>&nbsp;</p>
<h4>Various small changes</h4>
<ul>
<li>You can zoom the work area as you can in your browser. Just hold down <code>[Ctrl]</code>while rolling the wheel of you mouse up and down. Guess that woud be nice for elderly people like me <img src='http://www.netsi.dk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   </li>
<li>All these improvements also apply to the <strong>free</strong> <a title="Go to this url to start installing the Visual Web Developer 2010 Express" href="http://www.microsoft.com/web/gallery/install.aspx?appid=VWD2010" target="_blank">Visual Web Developer 2010 Express</a>! </li>
</ul>
<p>&nbsp;</p>
</p>
<h5>Links</h5>
<ul>
<li><a title="JavaScript Intellisense Improvements with VS 2010 - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2010/04/08/javascript-intellisense-improvements-with-vs-2010.aspx" target="_blank">JavaScript Intellisense Improvements with VS 2010 &#8211; on ScottGu&#8217;s Blog</a>  </li>
<li><a title="VS 2010 and .NET 4 Series - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx" target="_blank">VS 2010 and .NET 4 Series &#8211; on ScottGu&#8217;s Blog</a> </li>
</ul>
<pre></pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F09%2F22%2Fimprovements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript%2F&amp;title=Improvements%20in%20Microsoft%20Visual%20Studio%202010%2C%20from%20a%20frontend%20webdevelopers%20point%20of%20view%2C%20part%201%3A%20javascript" id="wpa2a_6"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using objects as keys in javascript, watch out!</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/09/18/using-objects-as-keys-in-javascript/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/09/18/using-objects-as-keys-in-javascript/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 17:01:03 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/09/18/using-objects-as-keys-in-javascript/</guid>
		<description><![CDATA[body {font-size: 11px; font-family: tahoma, arial, sans-serif;} .keyvalue {width: 800px; border: dotted 1px #e0e0e0;} .key {width: 290px; float: left; padding: 0px 5px 0px 5px; clear: both;} .value {width: 290px; float: left; padding: 0px 5px 0px 5px;} Here is an example of using various objects as keys in javascript. It is no problem in javascript! Update:&#160; [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
body {font-size: 11px; font-family: tahoma, arial, sans-serif;}
    .keyvalue {width: 800px; border: dotted 1px #e0e0e0;}
  	.key {width: 290px; float: left; padding: 0px 5px 0px 5px; clear: both;}
  	.value {width: 290px; float: left; padding: 0px 5px 0px 5px;}
  </style>
<div>
<table style="background: white" border="0" cellspacing="2" cellpadding="0">
<tbody>
<tr>
<td style="background-color: white !Important;">
<div style="width: 68px; height: 64px"><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image8.png" rel="lightbox[376]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Information" border="0" alt="Information" align="absMiddle" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb8.png" width="58" height="54" /></a></div>
</td>
<td style="background-color: white !Important;">
<div style="height: 64px">Here is an example of using various objects as keys in <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a>. <strike>It is <strong>no problem</strong> in javascript!</strike>               <br /><strong>Update:</strong>&#160; I was fooled by javascript. Actually you cannot use objects as keys in standard javascript. I read the comment below from <em>Kambhase</em> and tested his example. It is a fact that <strong>you cannot in standard javascript use objects as keys.                <br /></strong></div>
</td>
</tr>
</tbody>
</table></div>
<p style="clear: both">
<h2>Why it does not work</h2>
<p>I read the article here: <a title="http://www.timdown.co.uk/jshashtable/" href="http://www.timdown.co.uk/jshashtable/">http://www.timdown.co.uk/jshashtable/</a> – a page where you can download a javascript which will give you code allowing you to get an implementation of Hashtables, which <strong>can</strong> use objects as keys.     <br /><a title="Visit the website of Tim Down" href="http://www.timdown.co.uk/">Tim Down</a>, the author of the above jshashtable code, writes amount others about why you cannot use objects as keys:</p>
<blockquote><p>The reason for this is that JavaScript silently calls toString() on the object being passed in as the key and uses the result as the property name. In the example above, key1 and key2 both become &quot;[object Object]&quot;, hence the second assignment simply replaces the original value of the property &quot;[object Object]&quot;.</p></blockquote>
<p>This also indirectly explaines why my code below seems to work: I only have <strong>one</strong> “custom object” (an object without a <code>toString</code> method implemented), and so run into no conflicting as <a title="Visit the website of Tim Down" href="http://www.timdown.co.uk/">Tim Down</a> describes in the above quote.</p>
<p>So if you need objects as keys in a Hashtable: Use the code <a title="Visit the website of Tim Down" href="http://www.timdown.co.uk/">Tim Down</a> have created, found here: <a title="http://www.timdown.co.uk/jshashtable/" href="http://www.timdown.co.uk/jshashtable/">http://www.timdown.co.uk/jshashtable/</a></p>
</p>
<h2>Code</h2>
<pre id="codeContainer" class="javascript" name="code">var a = 1.23456;
var b = new Date();
var c = { my: 'object' }
var d = function() { alert('My function') };
var arr = [];
arr[a] = (typeof a) + ' (' + a + ')';
arr[b] = (typeof b) + ' (' + b + ')';
arr = (typeof c) + ' (' + c + ')';
arr[d] = (typeof d) + ' (' + d + ')';</pre>
<h2>Output</h2>
<div id="example">
<div class="keyValue"><strong class="key">Key</strong><strong class="value">Value</strong></div>
<div class="keyValue"><span class="key">1.23456</span><span class="value">number (1.23456)</span></div>
<div class="keyValue"><span class="key">Sat Sep 18 18:49:18 UTC+0200 2010</span><span class="value">object (Sat Sep 18 18:49:18 UTC+0200 2010)</span></div>
<div class="keyValue"><span class="key">[object Object]</span><span class="value">object ([object Object])</span></div>
<div class="keyValue"><span class="key">function() { alert(&#8216;My function&#8217;) }</span><span class="value">function (function() { alert(&#8216;My function&#8217;) })</span></div>
</div>
<div style="clear: both"></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F09%2F18%2Fusing-objects-as-keys-in-javascript%2F&amp;title=Using%20objects%20as%20keys%20in%20javascript%2C%20watch%20out%21" id="wpa2a_8"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/09/18/using-objects-as-keys-in-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JSON viewer &#8211; comes handy</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/05/14/json-viewer-comes-handy/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/05/14/json-viewer-comes-handy/#comments</comments>
		<pubDate>Fri, 14 May 2010 13:29:27 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/05/14/json-viewer-comes-handy/</guid>
		<description><![CDATA[Today I came across a JSON file, hmm… I love the opportunities that JSON gives you as a developer, but it is very compressed and not especially human friendly. Unlike XML, which on the other hand calls for a lot of coding inside a program to convert it into anything other that just data. JSON [...]]]></description>
			<content:encoded><![CDATA[<p><abbr class="datetime" title="2010-05-14">Today</abbr> I came across a <a href="http://www.netsi.dk/wordpress/index.php/tag/json/" class="st_tag internal_tag" rel="tag" title="Posts tagged with JSON">JSON</a> file, hmm… I love the opportunities that <a href="http://www.netsi.dk/wordpress/index.php/tag/json/" class="st_tag internal_tag" rel="tag" title="Posts tagged with JSON">JSON</a> gives you as a developer, but it <strong>is</strong> very compressed and not especially human friendly. Unlike XML, which on the other hand calls for a lot of coding inside a program to convert it into anything other that just data. JSON can contain actual code, functions, objects and ofcause data.</p>
<p>I then googled for JSON viewer and found a very cool tool! <a title="Here you can find the JSON viewer" href="http://jsonviewer.codeplex.com/" target="_blank">“JSON viewer” at codeplex.com</a>. It comes in three variants:</p>
</p>
<ol>
<li>A standalone viewer &#8211; JsonView.exe (view <a title="Example screenshoot, viewing JSON in standalone version" href="http://screencast.com/t/ZjllMmU1YWQt" target="_blank">example screenshoot</a>)      <br />No doubt – I found this very easy to use. Click to start, paste JSON and view it…      </li>
<li>A plugin for Fiddler 2 (http://www.fiddler2.com/) &#8211; FiddlerJsonViewer.dll     <br />Well, I do not have it installed.      </li>
<li>A visualizer for Visual Studio 2005 &#8211; JsonVisualizer.dll     <br />I followed the instructions (though in VS2008), but never really got to a point where I saw the visualizer appear. Perhaps I just dont get the concept of visualizer.</li>
</ol>
<p>I will not go any further into how to install it, I believe that the readme.txt inside the ZIP file should explain that part. And how to use it – well, try downloading this JSON: <a title="http://www.netsi.dk/wordpress/wp-content/uploads/2010/05/exampleJSON.js" href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/05/exampleJSON.js">http://www.netsi.dk/wordpress/wp-content/uploads/2010/05/exampleJSON.js</a> and play around with it!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F05%2F14%2Fjson-viewer-comes-handy%2F&amp;title=JSON%20viewer%20%26ndash%3B%20comes%20handy" id="wpa2a_10"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/05/14/json-viewer-comes-handy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery UI, is it easy?</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/02/21/using-jquery-ui-is-it-easy/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/02/21/using-jquery-ui-is-it-easy/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 11:10:33 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Is it easy?]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/02/21/using-jquery-ui-is-it-easy/</guid>
		<description><![CDATA[The javascript API jQuery is a very powerfull libray which have revolutionised the use of clientside javascript in browsers. Along the side of jQuery exists jQuery UI a library of strongly customizable widgets. It offers a wide range of &#34;easy-to-implement&#34; widgets for your website. I will try in this post to implement a datepicker and [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> API <a href="http://www.netsi.dk/wordpress/index.php/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a> is a <strong>very</strong> powerfull libray which have revolutionised the use of clientside javascript in browsers. Along the side of jQuery exists <strong><a href="http://www.netsi.dk/wordpress/index.php/tag/jquery-ui/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jQuery UI">jQuery UI</a></strong> a library of strongly customizable widgets. It offers a wide range of &quot;easy-to-implement&quot; widgets for your website. I will try in this post to implement a <code>datepicker</code> and conclude in the end if it is easy!
<p>Read <a title="Read the article [Using jQuery UI, is it easy]" href="http://www.netsi.dk/showcases/jQuery_UI.html" target="_blank">the article</a> and post your comments here on this page.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F02%2F21%2Fusing-jquery-ui-is-it-easy%2F&amp;title=Using%20jQuery%20UI%2C%20is%20it%20easy%3F" id="wpa2a_12"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/02/21/using-jquery-ui-is-it-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript intellisense in Microsoft Visual Studio 2008 (VS2008)</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/02/09/javascript-intellisense-in-microsoft-visual-studio-2008-vs2008/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/02/09/javascript-intellisense-in-microsoft-visual-studio-2008-vs2008/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 21:57:22 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[intellisence]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Microsoft Visual studio 2008]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/02/09/javascript-intellisense-in-microsoft-visual-studio-2008-vs2008/</guid>
		<description><![CDATA[When I first saw that Microsoft Visual Studio 2008 (VS2008) started to allow for intellisence on javascript I was happy! Not many seconds after that my suspicious old mind saw some problems, one of them was the fact that the vast amount of documentation would follow the javascript files making them too big and slow [...]]]></description>
			<content:encoded><![CDATA[<p><em>When I first saw that <a href="http://www.netsi.dk/wordpress/index.php/tag/microsoft-visual-studio-2008/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft Visual studio 2008">Microsoft Visual Studio 2008</a> (VS2008) started to allow for <a href="http://www.netsi.dk/wordpress/index.php/tag/intellisence/" class="st_tag internal_tag" rel="tag" title="Posts tagged with intellisence">intellisence</a> on <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> I was happy! Not many seconds after that my suspicious old mind saw some problems, one of them was the fact that the vast amount of <a href="http://www.netsi.dk/wordpress/index.php/tag/documentation/" class="st_tag internal_tag" rel="tag" title="Posts tagged with documentation">documentation</a> would follow the javascript files making them too big and slow down pages using them.</em></p>
<h3>The <a href="http://www.netsi.dk/wordpress/index.php/tag/intellisense/" class="st_tag internal_tag" rel="tag" title="Posts tagged with intellisense">intellisense</a> got smarter!</h3>
<p>The way that the intellisense got smarter is that VS2008 <strong>allows you to have the documentation in a seperate file</strong>. That way your main code will not be “heavy” for browsers to use – only at development time will the “-vsdoc” documentation file be used! </p>
<p>VS2008 will search for documentation in 3 predefined files – 3 patterns will be searched for: If you have a library, say &quot;<strong>mylibrary.js</strong>&quot;, VS2008 will search for documentation in the same directory in this order</p>
<ol>
<li>&quot;mylibrary<strong>-vsdoc</strong>.js&quot;, then if that is not found, a search for&#8230; </li>
<li>&quot;mylibrary<strong>.debug</strong>.js&quot;, then if that is not found, a search for&#8230; </li>
<li>&quot;mylibrary.js&quot; </li>
</ol>
<p>So if you program a javascript library you can add VS2008 intellisense code in a version named in one of the two ways shown above (or embedded in the main library), and then save it in the same folder as the actual library. This will introduce help on methodes in the library. </p>
<p>If no intellisence appers as you type try updating: “Edit &gt; IntelliSense &gt; Update Javascript IntelliSence (Ctrl+Shift+J)”. </p>
<p>To get this feature you will need to install this <a title="A hotfix for VS2008 which adds the descriped feature" href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" target="_blank">hotfix for VS2008</a>.</p>
<p>You can see a description of how to use the &quot;-vsdoc&quot; part in <a href="http://www.netsi.dk/wordpress/index.php/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a> here:    <br /><a title="Rich IntelliSense for jQuery" href="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx" target="_blank">Rich IntelliSense for jQuery</a>.</p>
<p>Below you can find links to related posts/articles – one of them “<a title="See how you can write your own javascript docs for VS2008" href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx" target="_blank">The format for JavaScript doc comments</a>” I thing is very important as it is a guide to how <strong>you</strong> add documentation (and intellisence) to <strong>your own</strong> javascript code. So now there are more than one argument to start documenting your code!</p>
<p>Happy documenting!</p>
<p>/Sten</p>
<p><strong>Related articles</strong></p>
<ul>
<li><a title="A guide to using Intellisence with the jQuery javascript library" href="http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx" target="_blank">jQuery Intellisense in VS 2008</a> </li>
<li><a title="JScript IntelliSense FAQ" href="http://blogs.msdn.com/webdevtools/archive/2008/11/18/jscript-intellisense-faq.aspx">JScript IntelliSense FAQ</a> </li>
<li><a title="See how you can write your own javascript docs for VS2008" href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx" target="_blank">The format for JavaScript doc comments</a> </li>
<li><a title="A hotfix for VS2008 which adds the descriped feature" href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" target="_blank">Hotfix for VS2008</a> </li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F02%2F09%2Fjavascript-intellisense-in-microsoft-visual-studio-2008-vs2008%2F&amp;title=Javascript%20intellisense%20in%20Microsoft%20Visual%20Studio%202008%20%28VS2008%29" id="wpa2a_14"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/02/09/javascript-intellisense-in-microsoft-visual-studio-2008-vs2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Closure javascript API &#8211; good or bad?</title>
		<link>http://www.netsi.dk/wordpress/index.php/2009/11/14/google-closure-javascript-api-good-or-bad/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2009/11/14/google-closure-javascript-api-good-or-bad/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 20:08:47 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[Google Colsure]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2009/11/14/google-closure-javascript-api-good-or-bad/</guid>
		<description><![CDATA[Since I first started to juse jQuery javascript API I have been a happy programmer! Things like cross browser, easy widget implementation and animation were suddently very easy to use. It was fast to implement, ran fast and as mentioned were rock solid accross browsers on various platforms! Finally: It started a trend of worldwide [...]]]></description>
			<content:encoded><![CDATA[<p>Since I first started to juse <a title="jQuery javascript API" href="http://jquery.com/" target="_blank">jQuery javascript API</a> I have been a happy programmer! Things like cross browser, easy <a href="http://www.netsi.dk/wordpress/index.php/tag/widget/" class="st_tag internal_tag" rel="tag" title="Posts tagged with widget">widget</a> implementation and animation were suddently very easy to use. It was fast to implement, ran fast and as mentioned were rock solid accross browsers on various platforms! Finally: It started a trend of worldwide unity amoung <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> developers – people very moving as a group.</p>
<p><strong>Javascript frameworks – a litle background      <br /></strong>Last year Microsoft realized that <a title="jQuery javascript API" href="http://jquery.com/" target="_blank">jQuery</a> was a very powerfull and solid javascript framework, the simply decided to adapt it and use it as their prefered javascript API. Not a thing which done often by such a big player! The company which perhaps has as many people who hate it as it has followers realized that open source code is something to respect and adapt!</p>
<p><a title="Google Colsure Javascript Library" href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html" target="_blank">Google Colsure</a> on the other hand – what is it? As I understand the framework is something which <a href="http://www.netsi.dk/wordpress/index.php/tag/google/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a> has developed for internal use, and now has opened up, so that everyone are free to use it. I must admit that I am not totally into all the terms of use and the history of this framework. However IMHO:</p>
<blockquote><p><font style="background-color: #ffffff">
<p>We don’t need Google to put one more player on the field of javascript frameworks! When it comes to javascript frameworks we need the unity amoung javascript developers – and a framework like <a href="http://www.netsi.dk/wordpress/index.php/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a> provides all the extensibility for any Google special needs.&#160; </p>
<p>   </font></p></blockquote>
<p><strong>What to do with “the new Microsoft” <img src='http://www.netsi.dk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ?      <br /></strong>It would be unrealistic to expect Google to “drop” its <a title="Google Colsure Javascript Library" href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html" target="_blank">Google Colsure</a> framework, but us &#8211; the javascript developers &#8211; might put presure on Google (the new Microsoft?). I for one do not need another javascript framework. So I will continue using jQuery.</p>
<p>I do not see Google as the new Microsoft – and Microsoft is not a bad company in my eyes. What however is bad is when <strong>one</strong> company is too big and can ignore other players without getting into trouble. Google is probertly not trying to push other javascript frameworks out of the field… Right Google? <img src='http://www.netsi.dk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Perhaps Google could try to convert their ideas into extentions/plug-ins to <a title="jQuery javascript API" href="http://jquery.com/" target="_blank">jQuery</a>?</p>
<p><strong>Other opinions about Google Closure      <br /></strong>Using <a title="TweetDeck: a simple and fast way to experience Twitter." href="http://www.tweetdeck.com/beta/" target="_blank">TweetDesk</a> I set up a search for “Closure Library” to follow the tweets about the Google Closure Library. Just followed one of them to: <a title="http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/" href="http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/">http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/</a></p>
<p><a title="Visit the site with the article: &quot;Google Closure: How not to write JavaScript&quot;" href="http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.netsi.dk/wordpress/wp-content/uploads/2009/11/image4.png" width="640" height="477" /></a> </p>
<p>That article was written by <a title="Read about Kevin Yank on www.sitepoint.com" href="http://www.sitepoint.com/articlelist/48" target="_blank">Kevin Yank</a> and he referes to some <a title="Google Colsure Javascript Library" href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html" target="_blank">Google Colsure</a> critism spoken by <a title="Visit the site of Dmitry Baranovskiy, the creator of the Raphaël and gRaphaël JavaScript libraries" href="http://dmitry.baranovskiy.com/" target="_blank">Dmitry Baranovskiy</a>. I myself have coded many lines of javascript and learned things just by reading this article! I also saw some scary “mistakes” which Dmitry pointed out in the new Google Closure framework. One of them was testing if a <code>var</code> was of the type <code>String</code> (From <a href="http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/base.js?r=2" target="_blank">base.js</a>, line 742):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">goog.<span style="color: #660066;">isString</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>val<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">typeof</span> val <span style="color: #339933;">==</span> <span style="color: #3366CC;">'string'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
  <br />The problem with that method (<code>isString</code>) is simply that it fails if you call it with a String object! Not cool! If you call it like this: <code>goog.isString(new String(‘My string’))</code> it will return <code>false</code>!</p>
<p>Ofcause nothing is perfect, and the points by <a title="Visit the site of Dmitry Baranovskiy, the creator of the Raphaël and gRaphaël JavaScript libraries" href="http://dmitry.baranovskiy.com/" target="_blank">Dmitry Baranovskiy</a> could easily be changed as a normal bug is fixed in any javascript framework. What scares me is the fact that many people seem to think that Google equals perfect, and if many people are non-sceptical about things developed by Google (Yahoo, Microsoft or anyone!) then perhaps they will leave jQuery and start using <a title="Google Colsure Javascript Library" href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html" target="_blank">Google Colsure</a> Library… I hope not!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2009%2F11%2F14%2Fgoogle-closure-javascript-api-good-or-bad%2F&amp;title=Google%20Closure%20javascript%20API%20%26ndash%3B%20good%20or%20bad%3F" id="wpa2a_16"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2009/11/14/google-closure-javascript-api-good-or-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Need custom fonts online? Try Cuf&#243;n!</title>
		<link>http://www.netsi.dk/wordpress/index.php/2009/10/29/need-custom-fonts-online-try-cufn/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2009/10/29/need-custom-fonts-online-try-cufn/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 21:56:37 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[inspirovation]]></category>
		<category><![CDATA[Cufón]]></category>
		<category><![CDATA[custom fonts]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/?p=127</guid>
		<description><![CDATA[I was tired of sIFR (flash based custom fonts) and decided to google for another soloution to adding custom (non web-standard fonts) to a webpage. I came across “Cufón” and decided to set up a target: If it is to be considered easy and out-of-the-box, the framework should be able to implement in 45 minutes! [...]]]></description>
			<content:encoded><![CDATA[<p>I was tired of sIFR (flash based <a href="http://www.netsi.dk/wordpress/index.php/tag/custom-fonts/" class="st_tag internal_tag" rel="tag" title="Posts tagged with custom fonts">custom fonts</a>) and decided to <a href="http://www.netsi.dk/wordpress/index.php/tag/google/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">google</a> for another soloution to adding custom (non web-standard fonts) to a webpage. I came across “<a href="http://www.netsi.dk/wordpress/index.php/tag/cufon/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Cufón">Cufón</a>” and decided to set up a target: If it is to be considered easy and out-of-the-box, the framework should be able to implement <strong>in 45 minutes!</strong></p>
<p>I succeded in 31 minutes – which included setting up a simple “<a href="http://www.netsi.dk/wordpress/index.php/tag/documentation/" class="st_tag internal_tag" rel="tag" title="Posts tagged with documentation">documentation</a>”/article about how I did! Now that article/webpage has been brushed up (making it more nice to look at) and I can think that it is worth a visit!</p>
<p>Find it on my domain here: <a title="A page showing how simple it is to setup custom fonts on your webpage using Cufón!" href="http://www.netsi.dk/showcases/cufon.html" target="_blank">http://www.netsi.dk/showcases/cufon.html</a>, it also has a few relevant links. Should you feel the need to submit comments about that page, feel free to do it here.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2009%2F10%2F29%2Fneed-custom-fonts-online-try-cufn%2F&amp;title=Need%20custom%20fonts%20online%3F%20Try%20Cuf%26oacute%3Bn%21" id="wpa2a_18"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2009/10/29/need-custom-fonts-online-try-cufn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get map using Google Static Maps</title>
		<link>http://www.netsi.dk/wordpress/index.php/2009/08/16/get-map-using-google-static-maps/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2009/08/16/get-map-using-google-static-maps/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 21:13:01 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[gadget]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/?p=81</guid>
		<description><![CDATA[You probertly know Google Maps and the API allowing you to embed maps with your information shown on the map. Google also offers a simpel API which allows you to plot simple maps just using an URL. The URL then has some parameters specifying things like zoom level, type of map and center of it. Though [...]]]></description>
			<content:encoded><![CDATA[<p>You probertly know <a href="http://www.netsi.dk/wordpress/index.php/tag/google/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a> <a href="http://www.netsi.dk/wordpress/index.php/tag/maps/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Maps">Maps</a> and the API allowing you to <a href="http://www.netsi.dk/wordpress/index.php/tag/embed/" class="st_tag internal_tag" rel="tag" title="Posts tagged with embed">embed</a> <a href="http://www.netsi.dk/wordpress/index.php/tag/maps/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Maps">maps</a> with your information shown on the <a href="http://www.netsi.dk/wordpress/index.php/tag/map/" class="st_tag internal_tag" rel="tag" title="Posts tagged with map">map</a>. Google also offers a <a target="_blank" href="http://code.google.com/intl/da/apis/maps/documentation/staticmaps/" title="Google Static Maps API">simpel API</a> which allows you to plot simple maps just using an URL. The URL then has some parameters specifying things like zoom level, type of map and center of it.</p>
<p>Though simpel to setup &#8211; those parameters – I have made a simple web application which will give you the URL you need to get the map you want.</p>
<p>Try it here: <a href="http://www.netsi.dk/showcases/getmap.html" title="http://www.netsi.dk/showcases/getmap.html">http://www.netsi.dk/showcases/getmap.html</a></p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2009/08/image2.png" rel="lightbox[81]"><img border="0" src="http://www.netsi.dk/wordpress/wp-content/uploads/2009/08/image-thumb2.png" alt="image" style="display: inline; border: 0px" title="image" height="127" width="596" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2009%2F08%2F16%2Fget-map-using-google-static-maps%2F&amp;title=Get%20map%20using%20Google%20Static%20Maps" id="wpa2a_20"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2009/08/16/get-map-using-google-static-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

