<?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; Code</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>Thu, 09 Feb 2012 08:52:19 +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>Controling styles for individual websites on shared CSS</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 08:49:56 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[kiss]]></category>
		<category><![CDATA[modenizr]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/</guid>
		<description><![CDATA[When working with CMS like Dynamicweb or Syncron VIA, you sometimes share stylesheet files across domains or subdomains. It makes sense to share common CSS codes when you want to some some common styles like fonts, colours or logos. &#160; The same styles… almost… It is also common that some small differences exists on subdomains, [...]]]></description>
			<content:encoded><![CDATA[<p>When working with CMS like <a href="http://www.netsi.dk/wordpress/index.php/tag/dynamicweb/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dynamicweb">Dynamicweb</a> or Syncron VIA, you sometimes share <a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> files across domains or subdomains. It makes sense to share common <a href="http://www.netsi.dk/wordpress/index.php/tag/css/" class="st_tag internal_tag" rel="tag" title="Posts tagged with css">CSS</a> codes when you want to some some common styles like fonts, colours or logos.</p>
<p>&#160;</p>
<h2>The same styles… almost…</h2>
<p>It is also common that some small differences exists on subdomains, perhaps a campaign site or a site target for a specific group of people. You then need to apply some small changes to those sites. Ofcause you can do this in many ways, and the CMS you use will probertly be a part of your decision on how to implement it. Here is one way to do it:</p>
<blockquote><h3>Add a CLASS to HTML tag with some site related information.</h3>
</blockquote>
<p>For instance I could add this code to my blog:</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span>html class=&quot;wwwnetsidk&quot;...</pre>
<p>The rule should be simple, for instance:</p>
<ul>
<li>Replace not-valid characters like “.” from the DOMAIN NAME to “nothing” </li>
</ul>
<p>The reason it should be simpel is that it makes it easy to figure out what it should be for a given domain name. Things which are using the <a title="Read about the acronym &quot;Kiss&quot; - keep it simple, stupid!" href="http://en.wikipedia.org/wiki/KISS_principle">KISS</a> (“Keep It Simple, Stupid!”) principle will more likely be used by people, as (in general) people are lazy (I know! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/02/wlEmoticon-smile.png" />, trust me.)</p>
<p>&#160;</p>
<p>When this rule have been applied you can add extra lines to your shared CSS file like this:</p>
<pre>html.wwwnetsidk {background-color: red;}</pre>
<p>The princip is used widely, for instance by <a href="http://www.modernizr.com/">http://www.modernizr.com/</a> which addes a lot of feature related classes to your HTML element telling you for instance which HTML5 features are supported. Just look here at parts of what modernizr adds to your HTML document:</p>
<pre title="Example of classes added to HTML element by modenizr">js no-touch postmessage history multiplebgs boxshadow opacity...</pre>
<h2><a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> example from Syncron Via CMS</h2>
<p>Here are an example of how I have implemented this feature in the Danish CMS system Syncron Via. The system is using XSLT a lot, and the code here is applied to the XSLT template used to render the outer Page data:</p>
<pre title="Define the class to be added to the HTML element in a variable and add it to the HTML class attribute.">&lt;xsl:variable name=&quot;serverName&quot; select=&quot;translate(/Page/RequestContent/ServerVariables/Entry[@Name='SERVER_NAME'], '.-', '')&quot; /&gt;
...
&lt;html class=&quot;{$serverName}&quot;...</pre>
<p>This is what I do: define the class to be added to the HTML element in a variable and add it to the HTML class attribute.</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%2F2012%2F02%2F09%2Fcontroling-styles-for-individual-websites-on-shared-css%2F&amp;title=Controling%20styles%20for%20individual%20websites%20on%20shared%20CSS" 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/2012/02/09/controling-styles-for-individual-websites-on-shared-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add entities to XSLT templates</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 12:52:39 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[entities;]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/</guid>
		<description><![CDATA[When you work with XSLT you sometimes need special characters like “«” and “»”. You can define “entities” which can then be used in the document. Here is how: &#160; &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!DOCTYPE xsl:stylesheet [ &#60;!ENTITY laquo &#34;&#38;#171;&#34;&#62; &#60;!ENTITY raquo &#34;&#38;#187;&#34;&#62; &#60;!ENTITY hellip &#34;&#38;#8230;&#34;&#62; ]&#62; &#60;xsl:stylesheet… You add the lines marked above. They defined [...]]]></description>
			<content:encoded><![CDATA[<p>When you work with <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> you sometimes need special characters like “«” and “»”. You can define “entities” which can then be used in the document. Here is how:</p>
<p>&#160;</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!DOCTYPE xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> [
  &lt;!ENTITY laquo &quot;&amp;#171;&quot;&gt;
  &lt;!ENTITY raquo &quot;&amp;#187;&quot;&gt;
  &lt;!ENTITY hellip &quot;&amp;#8230;&quot;&gt;
]&gt;
&lt;xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a>…</pre>
<p>You add the lines marked above. They defined a relation between a entity name and a character code. For instance the “laquo” will make it possibel for you to use &amp;laquo; when inserting a “«”.</p>
<p>&#160;</p>
<h3>HTML Entities codes</h3>
<p>The website “<a title="A very well structured overview of HTML entities codes" href="http://entitycode.com/" target="_blank">entitycode.com</a>” has a very nice structured overview of HTML Entities Codes. You can see the relation between characters, their entity name, the decimal code and a short description of the character. They are very well organised in categories, go and see it for your self…</p>
<p>&#160;</p>
<h4>Links</h4>
<ul>
<li><a title="A very well structured overview of HTML entities codes" href="http://entitycode.com/" target="_blank">entitycode.com</a> </li>
<li><a href="http://stackoverflow.com/questions/31870/using-a-html-entity-in-xslt-e-g-nbsp">Stackoverflow.com: Using a html entity in xslt (e.g. &amp;nbsp;)</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%2F2012%2F01%2F18%2Fhow-to-add-entities-to-xslt-templates%2F&amp;title=How%20to%20add%20entities%20to%20XSLT%20templates" 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/2012/01/18/how-to-add-entities-to-xslt-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Did you remember to exclude namespaces from output?</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 12:06:40 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[C# in XSLT]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/</guid>
		<description><![CDATA[When you work with XSLT, transforming XML to for instance the web in some CMS system, you might use some extra namespaces. Perhaps the CMS offers you some utilitiy namespace to handle relevant datastructure or procedures. You add them to your XSLT but perhaps you forgot to tell the XSLT processor not to add the [...]]]></description>
			<content:encoded><![CDATA[<p>When you work with <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a>, transforming XML to for instance the web in some CMS system, you might use some extra namespaces. Perhaps the CMS offers you some utilitiy <a href="http://www.netsi.dk/wordpress/index.php/tag/namespace/" class="st_tag internal_tag" rel="tag" title="Posts tagged with namespace">namespace</a> to handle relevant datastructure or procedures. You add them to your <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> but perhaps you forgot to tell the <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> processor not to add the namespaces to the output? Well I do some times… </p>
<p>&#160;</p>
<h2>Namespaces in a XSLT template</h2>
<p>Adding namespaces to get extra features in your XSLT templates is easy. You may or may not think about it, but you will allways add at least one namespace “xsl”. Using Microsoft Visual Studio and selecting “New XSLT…” you will probertly also get a MS namespace like this: “msxsl”. I all happens in the beging of the template like this:</p>
<pre>&lt;xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;
  exclude-result-prefixes=&quot;msxsl &quot;
  xmlns:cs=&quot;urn:custom-cs&quot;
&gt;</pre>
<p>In the above example there are three namespaces:</p>
<ul>
<li>xmlns:<strong>xsl</strong>=&quot;http://www.w3.org/1999/XSL/Transform&quot; </li>
<li>xmlns:<strong>msxsl</strong>=&quot;urn:schemas-microsoft-com:xslt&quot; </li>
<li>xmlns:<strong>cs</strong>=&quot;urn:custom-cs&quot; </li>
</ul>
<p>The first one “xsl” is telling the XSLT processor that we are using XSLT and that the we will be using the XSLT rules defined in 1999 by w3.org. </p>
<p>The next one “msxsl” addes MS custom features and will give you some nice new features, for instance <a title="Converts standard XSD date formats to characters suitable for output." href="http://msdn.microsoft.com/en-us/library/ms256099.aspx" target="_blank">functions to format dates (ms:format-date Function)</a>. </p>
<p>The last one I use for adding custom C# code in my XSLT. That is a very powerfull way of extending the XSLT processor with your own custom .NET code. But <a title="Read my blog post about adding C# to XSLT, this links to part 1." href="http://www.netsi.dk/wordpress/index.php/2009/12/19/using-c-in-xslt-transformations-very-strong-tool/" target="_blank">please take care when doing that</a>!</p>
<p>&#160;</p>
<h2>Removing the namespace from the output</h2>
<p>If you use custom namespaces you may end up with the namespaces added to the output elements. In the above code you may observe that there is an attribute “exclude-result-prefixes” on the xsl:stylesheet tag. It is used to tell the XSLT processor which namespaces should not be added to the output elements. I have added “msxsl” but not “cs”. I the example I use XSLT in <a href="http://www.netsi.dk/wordpress/index.php/tag/dynamicweb/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dynamicweb">Dynamicweb</a> CMS to generate HTML, so I may get output looking like this:</p>
<pre>&lt;ul xmlns:cs=&quot;urn:custom-cs&quot;&gt;</pre>
<p>That is not what I wanted! To remove the “cs” namespace I simply need to modify the xsl:stylesheet attribute “exclude-result-prefix” to:</p>
<pre>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;
  exclude-result-prefixes=&quot;msxsl <strong>cs</strong>&quot;
  xmlns:cs=&quot;urn:custom-cs&quot;
&gt;</pre>
<p>I have added the “cs” namespace, so I will now get a tag without the “cs” namespace in my HTML.</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%2F2012%2F01%2F16%2Fdid-you-remember-to-exclude-namespaces-from-output%2F&amp;title=Did%20you%20remember%20to%20exclude%20namespaces%20from%20output%3F" 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/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extend Object with method that handles CSS values in javascript</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/12/extend-object-with-method-that-handles-css-values-in-javascript/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/12/extend-object-with-method-that-handles-css-values-in-javascript/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 08:59:55 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[getCSSValueAndUnit]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/12/extend-object-with-method-that-handles-css-values-in-javascript/</guid>
		<description><![CDATA[If you are working with CSS and need to for instance add or subtract a value to a CSS value like “15px” or “3em” this method “getCSSValueAndUnit()” will come in handy. Simply add the code somewhere in the top to extend the “Object” object. &#160; The method is used as follows: &#34;10px&#34;.getCSSValueAndUnit(); which will return [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working with <a href="http://www.netsi.dk/wordpress/index.php/tag/css/" class="st_tag internal_tag" rel="tag" title="Posts tagged with css">CSS</a> and need to for instance add or subtract a value to a <a href="http://www.netsi.dk/wordpress/index.php/tag/css/" class="st_tag internal_tag" rel="tag" title="Posts tagged with css">CSS</a> value like “15px” or “3em” this method “<a href="http://www.netsi.dk/wordpress/index.php/tag/getcssvalueandunit/" class="st_tag internal_tag" rel="tag" title="Posts tagged with getCSSValueAndUnit">getCSSValueAndUnit</a>()” will come in handy.</p>
<p>Simply add the code somewhere in the top to extend the “Object” object.</p>
<p>&#160;</p>
<p>The method is used as follows:</p>
<pre>&quot;10px&quot;.getCSSValueAndUnit();</pre>
<p>which will return an object:</p>
<pre>{ 'value':10, 'unit':'px' }</pre>
<p>Simple but very usefull!</p>
<p>&#160;</p>
<pre>Object.prototype.getCSSValueAndUnit = function() {
  var oReUnit = new RegExp('[0123456789\.-]', 'ig');
  var sOriginal = this.toString();
  var sUnitRaw = sOriginal.replace(oReUnit, '')
  var sUnit = sUnitRaw.replace(new RegExp(' ', 'ig'), '');
  var vValue = parseFloat(sOriginal.replace(sUnitRaw,''));
  return {'value':vValue, 'unit':sUnit};
}</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%2F2012%2F01%2F12%2Fextend-object-with-method-that-handles-css-values-in-javascript%2F&amp;title=Extend%20Object%20with%20method%20that%20handles%20CSS%20values%20in%20javascript" 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/2012/01/12/extend-object-with-method-that-handles-css-values-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YouTube som din video base, en rigtig god id&#233;!</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/03/youtube-som-din-video-basedet-er-smart/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/03/youtube-som-din-video-basedet-er-smart/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:16:35 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[YouTube]]></category>
		<category><![CDATA[lidt om]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/03/youtube-som-din-video-basedet-er-smart/</guid>
		<description><![CDATA[Kort om video på nettet Hvis du har nogle videoer som du ønsker at dele med venner eller kunder så er YouTube bestemt et godt bud på et sted at gøre det. Du opnår mange gratis muligheder, og Google er jo bestemt ikke en dårlig “partner” på det felt! &#160; Her er et par af [...]]]></description>
			<content:encoded><![CDATA[<h2>Kort om <a href="http://www.netsi.dk/wordpress/index.php/tag/video/" class="st_tag internal_tag" rel="tag" title="Posts tagged with video">video</a> på nettet</h2>
<p>Hvis du har nogle videoer som du ønsker at dele med venner eller kunder så er <a href="http://www.netsi.dk/wordpress/index.php/tag/youtube-2/" class="st_tag internal_tag" rel="tag" title="Posts tagged with youtube">YouTube</a> bestemt et godt bud på et sted at gøre det. Du opnår mange gratis muligheder, og Google er jo bestemt ikke en dårlig “partner” på det felt!</p>
<p>&#160;</p>
<p>Her er et par af de features som jeg mener er guld værd – og der er flere som ikke er nævnt!</p>
<p>&#160;</p>
<h3>Man kan se og uploade til YouTube på mange måder</h3>
<p>Om du sidder med en iPad, en Windows baseret PC eller en Apple iOS computer så kan du uploade dine videoer til YouTube. Du kan navngive, beskrive, tagge og generelt kontrolere hvordan dine videoer skal fremstå på nettet. Dine videoer bliver søgbare, hvis du giver lov til det!, og de bliver relateret til lignende videoer.</p>
<p>&#160;</p>
<p>Videoer fra YouTube kan afspilles på næsten alle devices, lige fra mobil, over “pads”, moderne TV’er (i stuen hos folk) eller på computere. Du skal ikke gøre noget for at konvertere til forskellige video formater – det sørger YouTube for. Dine venner kan synes om dem, gemme dem som deres favoritter eller dele dem f.eks. på Facebook.</p>
<p>&#160;</p>
<p>Du kan få din egen video kanal, geotagge dem og se statistik over hvordan dine videoer er blevet anvendt, set eller delt. Hvilke type brugere og hvor kommer de fra? Hvor mange gange er din video blevet set, og så videre…</p>
<p>&#160;</p>
<p>Du kan nemt dele dine videoer fra din hjemmeside, du kan e-maile den til venner eller kunder, alt sammen på dit eget sprog.</p>
<p>&#160;</p>
<p>Jeg vil derfor anbefale at man får sig en konto på YouTube og bruger det til at gemme sine videoer – det er jo også en god måde at have backup i “skyen” af ens videoer. Se disse screenshoots fra min youtube konto (<a href="http://www.youtube.com/netsi64">http://www.youtube.com/netsi64</a>).</p>
<p>&#160;</p>
<h3>Screenshoots fra min konto</h3>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image.png" rel="lightbox[744]"><img style="margin: 0px 10px 10px 0px; display: inline; float: left" title="Sådan ser en video ud når folk ser på den" alt="Sådan ser en video ud når folk ser på den" align="left" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image_thumb.png" width="189" height="240" /></a></p>
<p><strong>Når folk ser videoen</strong></p>
<p>Her er et eksempel på en video jeg har lavet ved hjælp af min mobiltelefon og en app som kan optage “time-lapse” video. Time-lapse er hvor man tager et billede med et givet interval (f.eks. 1 sekund) og så afspiller det med 25 billeder i sekundet. Det giver en morsom effekt, her er det f.eks. en køretur til Aarhus fra Løgten – det tager så 0:21 minutter!!</p>
<p style="clear: both"><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image1.png" rel="lightbox[744]"><img style="margin: 0px 0px 10px 10px; display: inline; float: right" title="At redigere information relateret til video er meget nemt" alt="At redigere information relateret til video er meget nemt" align="right" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image_thumb1.png" width="185" height="240" /></a></p>
<p><strong>Rediger oplysninger</strong></p>
<p>Det er så simpelt som at klikke “Rediger oplysninger” og man er igang med at kunne redigere de oplysninger som hører til videoen. Det betyder f.eks. at du kan uploade først og tilføje relevante information senere.</p>
<p>&#160;</p>
<p>Folk kan iøvrigt kommentere og rate dine videoer. Noget som ja, selvfølgelig er gratis.</p>
<p style="clear: both">
<p style="clear: both"><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image2.png" rel="lightbox[744]"><img style="margin: 0px 10px 10px 0px; display: inline; float: left" title="Statistik vises overskueligt og med mange facetter" alt="Statistik vises overskueligt og med mange facetter" align="left" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/image_thumb2.png" width="240" height="183" /></a><strong>Statistik/analytics</strong></p>
<p>Der er ret professionelle statistiske oplysninger som kan være ret interessante at se. Google har styr på det og man føler sig rigtig godt dækket ind på det felt.</p>
<p style="clear: both"><strong>Mange andre muligheder</strong></p>
<p style="clear: both">YouTube er udbredt og kendt af mange, selv TV-stationer viser klip derfra. Hvis du bruger YouTube professionelt er der også den fordel at mange CMS systemer integrerer godt til det, der er mange webudviklere som kan hjælpe dig og nettet bugner med gode vejledninger og råd til denne state of the art video tjenste.</p>
<p style="clear: both">&#160;</p>
<p style="clear: both">Så jeg kan kun anbefale at du bruger denne fantastiske gratis service fra YouTube.</p>
<p style="clear: both">&#160;</p>
<h5>Iøvrigt…</h5>
<p>Skulle du nu sidde og have fået lyst til at se ovennævnte video eksempel så kan du se den her – for Windows Live Writer, som jeg bruger til at blogge med, kan selvfølgelig indlejre videoer fra YouTube gennem et par klik! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/01/wlEmoticon-smile.png" /></p>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c175b60e-b9a3-41d7-bd3f-e1f07fbce5cd" class="wlWriterSmartContent">
<div><embed height="252" type="application/x-shockwave-flash" width="448" src="http://www.youtube.com/v/nzce6XqDAFM?hl=en&amp;hd=1" /> </div>
<div style="width: 448px; clear: both; font-size: 0.8em">Min Time-lapse video–indsat nemt og smertefrit via Windows Live Writer…</div>
</p></div>
<h5>Relateret indhold </h5>
<ul>
<li><a title="Her kan du få genereret den HTML kode der skal til for at indsætte video generelt på en hjemmeside" href="http://sandbox.thewikies.com/vfe-generator/" target="_blank">Video for everybody generator</a> </li>
<li>Et rigtig godt gratis video konvertering program: <a title="Dette program er rigtig godt til at konvertere mellem forskellige video formater" href="http://www.freemake.com/free_video_converter/" target="_blank">Free Video Converter</a> </li>
<li><a title="Widget til at indsætte en YouTube video" href="http://code.google.com/intl/da/apis/youtube/youtube_player_demo.html" target="_blank">Google YouTube player demo</a> &#8211; hjælp til udviklere der ønsker at indsætte YouTube videoer i deres HTML.</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%2F2012%2F01%2F03%2Fyoutube-som-din-video-basedet-er-smart%2F&amp;title=YouTube%20som%20din%20video%20base%2C%20en%20rigtig%20god%20id%26eacute%3B%21" 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/2012/01/03/youtube-som-din-video-basedet-er-smart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blog indl&#230;g om opdateret nyhedsmodul i Dynamicweb 8</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/12/28/blog-indlg-om-opdateret-nyhedsmodul-i-dynamicweb-8/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/12/28/blog-indlg-om-opdateret-nyhedsmodul-i-dynamicweb-8/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 10:49:52 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[Dynamicweb 8]]></category>
		<category><![CDATA[Nyhedsmodul]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/12/28/blog-indlg-om-opdateret-nyhedsmodul-i-dynamicweb-8/</guid>
		<description><![CDATA[Dynamicweb version 8 er blevet releaset i december 2011 og det indeholder en række forbedringer, for eksempel er nyhedsmodulet blevet opgraderet. Peter Terkildsen har skrevet et blog indlæg på blog.bleau.dk om det opgraderede nyhedsmodul i Dynamicweb 8. Læs blandt andet om: Søgning i nyheder på tværs af alle nyhedskategorier Søgemaskinevenlige URL&#8217;er når man ser en [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.netsi.dk/wordpress/index.php/tag/dynamicweb/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dynamicweb">Dynamicweb</a> version 8 er blevet releaset i december 2011 og det indeholder en række forbedringer,   <br />for eksempel er nyhedsmodulet blevet opgraderet. <a title="Hvem er Peter Terkildsen?" href="https://plus.google.com/110363459082025323944/posts" target="_blank">Peter Terkildsen</a> har skrevet et blog indlæg på <a title="blog.bleau.dk indeholder gode blog posts" href="http://blog.bleau.dk" target="_blank">blog.bleau.dk</a> om det opgraderede <a href="http://www.netsi.dk/wordpress/index.php/tag/nyhedsmodul/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Nyhedsmodul">nyhedsmodul</a> i Dynamicweb 8.</p>
<p>Læs blandt andet om:</p>
<ul>
<li>Søgning i nyheder på tværs af alle nyhedskategorier</li>
<li>Søgemaskinevenlige URL&#8217;er når man ser en enkelt nyhed</li>
<li>Nyheder kan indgå i flere kategorier</li>
</ul>
<p>Læs hele blog indlæget her: <a title="Læs blog indlæg om det opdaterede nyhedsmodul i Dynamicweb 8" href="http://blog.bleau.dk/2011/nye-muligheder-i-nyhedsmodulet-i-dynamicweb-8/" target="_blank">http://blog.bleau.dk/2011/nye-muligheder-i-nyhedsmodulet-i-dynamicweb-8/</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%2F12%2F28%2Fblog-indlg-om-opdateret-nyhedsmodul-i-dynamicweb-8%2F&amp;title=Blog%20indl%26aelig%3Bg%20om%20opdateret%20nyhedsmodul%20i%20Dynamicweb%208" 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/2011/12/28/blog-indlg-om-opdateret-nyhedsmodul-i-dynamicweb-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery trigger() will not always fire naturally-occurring event</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/12/03/jquery-trigger-will-not-always-fire-naturally-occurring-event/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/12/03/jquery-trigger-will-not-always-fire-naturally-occurring-event/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 21:00:07 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[trigger(); click(); soloution]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/12/03/jquery-trigger-will-not-always-fire-naturally-occurring-event/</guid>
		<description><![CDATA[If you want to trigger (fire) an event on say a link with id=test from jQuery you can use the jQuery(‘#test’).trigger('click') which will simulate that a click event has occured and will execute any jQuery attached events. This is fine, but what if you have not assigned an jQuery event handler? You can simply call [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to trigger (fire) an event on say a link with id=test from jQuery you can use the</p>
<blockquote><p><code>jQuery(‘#test’).trigger('click')</code></p>
</blockquote>
<p>which will simulate that a click event has occured and will execute any <strong>jQuery</strong> attached events. This is fine, but what if you have not assigned an jQuery event handler? You can simply call the native click() method on the element like this:</p>
<blockquote><p><code>jQuery('#test').each(function() {</code>       <br /><code>&#160; this.click();</code>       <br /><code>})</code></p>
</blockquote>
<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%2F12%2F03%2Fjquery-trigger-will-not-always-fire-naturally-occurring-event%2F&amp;title=jQuery%20trigger%28%29%20will%20not%20always%20fire%20naturally-occurring%20event" 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/2011/12/03/jquery-trigger-will-not-always-fire-naturally-occurring-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding up you CSS in Visual Studio using Web Essentials plug-in</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/11/29/speeding-up-you-css-in-visual-studio-using-web-essentials-plug-in/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/11/29/speeding-up-you-css-in-visual-studio-using-web-essentials-plug-in/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 20:06:21 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/11/29/speeding-up-you-css-in-visual-studio-using-web-essentials-plug-in/</guid>
		<description><![CDATA[Mads Kristensen (@mkristensen) is the name of the person bringing speed and hope for the CSS part of Microsoft Visual Studio. He is adding new life the the rather dead CSS part of Visual Studio. He is doing so through his free plug-in for Visual Studio: Web Essentials. The features In general Web Essentials makes [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Mads Kristensen Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET" href="http://madskristensen.net/page/about-mads-kristensen.aspx" target="_blank">Mads Kristensen</a> (<a title="Follow Mads Kristensen on Twitter" href="https://twitter.com/mkristensen" target="_blank">@mkristensen</a>) is the name of the person bringing speed and hope for the <a href="http://www.netsi.dk/wordpress/index.php/tag/css/" class="st_tag internal_tag" rel="tag" title="Posts tagged with css">CSS</a> part of Microsoft Visual Studio. He is adding new life the the rather dead <a href="http://www.netsi.dk/wordpress/index.php/tag/css/" class="st_tag internal_tag" rel="tag" title="Posts tagged with css">CSS</a> part of Visual Studio. He is doing so through his free <a href="http://www.netsi.dk/wordpress/index.php/tag/plug-in/" class="st_tag internal_tag" rel="tag" title="Posts tagged with plug-in">plug-in</a> for Visual Studio: <a title="Visit the page containing the Web Essentials plug-in for Visual Studio" href="http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f" target="_blank">Web Essentials</a>.</p>
<h1>The features</h1>
<p>In general <a title="Visit the page containing the Web Essentials plug-in for Visual Studio" href="http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f" target="_blank">Web Essentials</a> makes working with CSS in Visual Studio more nice, adding features like colour and font preview, change of values using Ctrl+Arrows (up=add, down=subtract as you know it from for instance Firebug and Google Chrome), option to base64 encode images and <a title="Read more about the speed typing feature added to visual studio with Web Essentials plug-in" href="http://madskristensen.net/post/CSS-speed-typing-for-Visual-Studio.aspx" rel="Read more about the speed typing feature added to visual studio with Web Essentials plug-in" target="_blank">speed typing</a>. I can only recommend this plug-in, and also the fact that Mads listens to you request given to him for instance through twitter makes me a happy user! Well done Mads, and keep up the good job! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://www.netsi.dk/wordpress/wp-content/uploads/2011/11/wlEmoticon-smile2.png" /></p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 12px 12px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Amoung other features: Embed image as base64 encoded image" border="0" alt="Amoung other features: Embed image as base64 encoded image" src="http://www.netsi.dk/wordpress/wp-content/uploads/2011/11/image7.png" width="789" height="239" /></p>
<h5>Links</h5>
<ul>
<li><a title="Another must read post about speeding up your work with webpages in Visual Studio" href="http://www.netsi.dk/wordpress/index.php/2009/12/02/zen-coding-a-very-fast-way-of-generating-html-elements-in-your-editor/" target="_blank">Zen coding plug-in</a> – You should also read that post if you want to speed up your work in general in Visual Studio</li>
<li><a title="Visit the page containing the Web Essentials plug-in for Visual Studio" href="http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f" target="_blank">Web Essentials</a> – find the plug-in here and read about all the features in it</li>
<li><a title="Mads Kristensen Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET" href="http://madskristensen.net/page/about-mads-kristensen.aspx" target="_blank">Mads Kristensen</a> (<a title="Follow Mads Kristensen on Twitter" href="https://twitter.com/mkristensen" target="_blank">@mkristensen</a>) – the developer of <a title="Visit the page containing the Web Essentials plug-in for Visual Studio" href="http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f" target="_blank">Web Essentials</a> plug-in</li>
<li>What is <a title="Base64 Encoding for Images explained" href="http://www.9lessons.info/2010/11/base64-encoding-for-images.html" target="_blank">Base64 encoding of images</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%2F2011%2F11%2F29%2Fspeeding-up-you-css-in-visual-studio-using-web-essentials-plug-in%2F&amp;title=Speeding%20up%20you%20CSS%20in%20Visual%20Studio%20using%20Web%20Essentials%20plug-in" 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/2011/11/29/speeding-up-you-css-in-visual-studio-using-web-essentials-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 seconds guide to Dynamicweb Newsletter v/3 templates (sending out news)</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/11/28/10-seconds-guide-to-dynamicweb-newsletter-v3-templates-sending-out-news/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/11/28/10-seconds-guide-to-dynamicweb-newsletter-v3-templates-sending-out-news/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 14:41:04 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[newsletter]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/11/28/10-seconds-guide-to-dynamicweb-newsletter-v3-templates-sending-out-news/</guid>
		<description><![CDATA[This is a short note on constructing news templates for Dynamicweb CMS Newsletter v/3 templates when sending out pieces of news. &#160; It can be tricky to create newsletters in HTML, doing it from Dynamicweb CMS using the Newsletter v/3 does, I am sorry to say, not make things easier. Using the snippet below you [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short note on constructing news templates for <a href="http://www.netsi.dk/wordpress/index.php/tag/dynamicweb/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dynamicweb">Dynamicweb</a> CMS <a href="http://www.netsi.dk/wordpress/index.php/tag/newsletter/" class="st_tag internal_tag" rel="tag" title="Posts tagged with newsletter">Newsletter</a> v/3 templates when sending out pieces of news.</p>
<p>&#160;</p>
<p>It can be tricky to create newsletters in HTML, doing it from Dynamicweb CMS using the Newsletter v/3 does, I am sorry to say, not make things easier. Using the snippet below you get the skeleton of the central news item loop:</p>
<p>&#160;</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">p</span><span class="kwrd">&gt;</span>Dear <span class="rem">&lt;!--@DWUserName--&gt;</span><span class="kwrd">&lt;/</span><span class="html">p</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">table</span><span class="kwrd">&gt;</span>
<span class="rem">&lt;!--@LoopStart(ItemsLoop)--&gt;</span>
<span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">td</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span>=&quot;&lt;!<span class="attr">--</span>@<span class="attr">LoopStart</span>(<span class="attr">IsSetupDetailLink</span>)<span class="attr">--</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span>@<span class="attr">ModuleDetailLink--</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span>@<span class="attr">LoopEnd</span>(<span class="attr">IsSetupDetailLink</span>)<span class="attr">--</span><span class="kwrd">&gt;</span>&quot;<span class="kwrd">&gt;&lt;!</span><span class="html">--</span>@<span class="attr">NewsHeading--</span><span class="kwrd">&gt;&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>
<span class="rem">&lt;!--@If Defined(NewsManchet)--&gt;</span>
<span class="rem">&lt;!--@NewsManchet--&gt;</span>
<span class="rem">&lt;!--@EndIf(NewsManchet)--&gt;</span>
<span class="rem">&lt;!--@If Not Defined(NewsManchet)--&gt;</span>
<span class="rem">&lt;!--@NewsText#100--&gt;</span>&amp;#8230;
<span class="rem">&lt;!--@EndIf(NewsManchet)--&gt;</span>
<span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span>=&quot;&lt;!<span class="attr">--</span>@<span class="attr">LoopStart</span>(<span class="attr">IsSetupDetailLink</span>)<span class="attr">--</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span>@<span class="attr">ModuleDetailLink--</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span>@<span class="attr">LoopEnd</span>(<span class="attr">IsSetupDetailLink</span>)<span class="attr">--</span><span class="kwrd">&gt;</span>&quot;<span class="kwrd">&gt;</span>Read more<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span>
<span class="rem">&lt;!--@LoopEnd(ItemsLoop)--&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
<p>.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 .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<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%2F11%2F28%2F10-seconds-guide-to-dynamicweb-newsletter-v3-templates-sending-out-news%2F&amp;title=10%20seconds%20guide%20to%20Dynamicweb%20Newsletter%20v%2F3%20templates%20%28sending%20out%20news%29" 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/2011/11/28/10-seconds-guide-to-dynamicweb-newsletter-v3-templates-sending-out-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing cross domain scripting&#8211;no problem</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/11/23/doing-cross-domain-scriptingno-problem/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/11/23/doing-cross-domain-scriptingno-problem/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 21:46:41 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[cross domain]]></category>
		<category><![CDATA[same origin policy]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/11/23/doing-cross-domain-scriptingno-problem/</guid>
		<description><![CDATA[Many times I have come across situations where I had an iFrame from which I needed to parse information or execute code between the iFrame and its parent window. It can be done with out any need for this soloution if the parent and the iframe is on the same domain. For instance: Parent window [...]]]></description>
			<content:encoded><![CDATA[<p>Many times I have come across situations where I had an iFrame from which I needed to parse information or execute code between the iFrame and its parent window. It can be done with out any need for this soloution if the parent and the iframe is on the same domain. For instance:</p>
<p>Parent window located at: www.shareddomain.com</p>
<p>Iframe located at: utils.shareddomain.com</p>
<p>I had the situation where the iFrame located on a subdomain needed to update its height as contents height changed. I made a function in the parent window setHeight(height) and tried to call it from the iFrame.</p>
<pre>// Code in Parent window
function setHeight(height) {
  // Javascript code which will change the height
  // of the iFrame
}

// Code in iFrame
jQuery(function() {
  // Calculate height of iFrame into var height
  parent.setHeight(height);
})</pre>
<p>I ran into the “<a title="Read about the same origin policy or cross domain policy" href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">same origin policy (cross domain issue)</a>” which is a security build into the browser to prevent scripts from one domain (origin) to access data/code in another domain. The code in the iFrame is blocked and not executed because of security issues related to <a href="http://www.netsi.dk/wordpress/index.php/tag/same-origin-policy/" class="st_tag internal_tag" rel="tag" title="Posts tagged with same origin policy">same origin policy</a>.</p>
<h3>The soloution: document.domain</h3>
<p>I read the information on the wiki about same origin policy and discovered a simpel working soloution. Add a piece of code into both scripts specifying the same domain:</p>
<pre>// Code in Parent window
<strong>document.domain = 'shareddomain.com';</strong>
function setHeight(height) {
  // Javascript code which will change the height
  // of the iFrame
}

// Code in iFrame
jQuery(function() {
  // Calculate height of iFrame into var height
  <strong>document.domain = 'shareddomain.com';
</strong>  parent.setHeight(height);
})</pre>
<p>The browser now allows the two windows to share properties and code, and the function from the parent window can be called from the iframe! Cool!</p>
<h5>Links</h5>
<ul>
<li>Wiki: <a title="Read about the same origin policy or cross domain policy" href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">Same origin policy (cross domain issue)</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%2F2011%2F11%2F23%2Fdoing-cross-domain-scriptingno-problem%2F&amp;title=Doing%20cross%20domain%20scripting%26ndash%3Bno%20problem" 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/2011/11/23/doing-cross-domain-scriptingno-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

