<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>justaddwater.dk &#187; JavaScript</title>
	<atom:link href="http://justaddwater.dk/category/webstandards/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://justaddwater.dk</link>
	<description>Instant Usability &#38; Web Standards</description>
	<lastBuildDate>Thu, 10 Jun 2010 08:23:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Introducing Tiny JavaScript Number Formatter</title>
		<link>http://justaddwater.dk/2008/08/18/introducing-tiny-javascript-number-formatter/</link>
		<comments>http://justaddwater.dk/2008/08/18/introducing-tiny-javascript-number-formatter/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 08:50:25 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=945</guid>
		<description><![CDATA[For a current project, I created a tiny number formatter that inserts thousand delimiters in a string:
10000 to 10,000 etc.
Just add css class=&#8221;numberformat currency&#8221; to a text field, and it will be formatted automatically.
It is based on the Prototype JavaScript library. You can get it from it&#8217;s GitHub repository page. Feel free to add or [...]]]></description>
			<content:encoded><![CDATA[<p>For a current project, I created a tiny number formatter that inserts thousand delimiters in a string:</p>
<p>10000 to 10,000 etc.</p>
<p>Just add css class=&#8221;numberformat currency&#8221; to a text field, and it will be formatted automatically.</p>
<p>It is based on the <a href="http://prototypejs.org">Prototype JavaScript library</a>. You can get it from it&#8217;s GitHub repository page. Feel free to add or alter the functionality. Releasing under Creative Commons license. </p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.</p>
<p>Some quick notes:</p>
<p>I&#8217;m using this on a rather big HTML page, so the selection of DOM nodes must be as simple and quick as possible. So if you are considering moderations, please make sure that the DOM manipulations are as lightweight as possible.</p>
<p>The script is as simple as possible. It does not parse the string as a number. Instead it just strips any thousand delimiters in the string. Afterwards it sets its own. There may be some important logic here to add to make the code more robust.</p>
<p>I have also added a test page to the project&#8230; not a real test page, but a HTML page that shows examples that are modified. Please back up any added functionality with changes to that page as well.</p>
<p>Contact me for commit access if you would like to contribute. I do not expect to add any functionality to the code unless the work project requires it. </p>
<p>More info:<br />
<a href="http://github.com/jesperronn/numberformat-js/">GitHub repository</a></p>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a>, <a href="http://technorati.com/tag/opensource" rel="tag"> opensource</a>, <a href="http://technorati.com/tag/project" rel="tag"> project</a>, <a href="http://technorati.com/tag/library" rel="tag"> library</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2008/08/18/introducing-tiny-javascript-number-formatter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Deprecation Warning in JavaScript Console</title>
		<link>http://justaddwater.dk/2008/07/17/adding-deprecation-warning-in-javascript-console/</link>
		<comments>http://justaddwater.dk/2008/07/17/adding-deprecation-warning-in-javascript-console/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 11:10:49 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=940</guid>
		<description><![CDATA[I used this quick trick today to help me clean up and refactor some javascript functions today:

if ("console" in window)
  console.warn('DEPRECATED function call to '+ arguments.callee
  +'\nCalled by:\n'+ arguments.callee.caller );

Which results in a fine deprecation warning in the console:

There is plenty of space for improvement here. Feel free to use or tamper &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>I used this quick trick today to help me clean up and refactor some javascript functions today:</p>
<pre>
<div class="codesnip-container" >if ("console" in window)
  console.warn('DEPRECATED function call to '+ arguments.callee
  +'\nCalled by:\n'+ arguments.callee.caller );</div>
</pre>
<p>Which results in a fine deprecation warning in the console:<br />
<a href='http://justaddwater.dk/wp-content/uploads/2008/07/firebug-javascript-caller-callee-debugger-warning.png'><img src="http://justaddwater.dk/wp-content/uploads/2008/07/firebug-javascript-caller-callee-debugger-warning.png" alt="" title="firebug-javascript-caller-callee-debugger-warning" width="500" height="249" class="alignnone size-full wp-image-941" /></a></p>
<p>There is plenty of space for improvement here. Feel free to use or tamper &#8230; but please post any alternative suggestions here as a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2008/07/17/adding-deprecation-warning-in-javascript-console/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>1996 Humour Ahead: Spacer.gif, Table Layouts</title>
		<link>http://justaddwater.dk/2007/12/06/1996-humour-ahead-spacergif-table-layouts/</link>
		<comments>http://justaddwater.dk/2007/12/06/1996-humour-ahead-spacergif-table-layouts/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 17:28:01 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/12/06/1996-humour-ahead-spacergif-table-layouts/</guid>
		<description><![CDATA[In case you missed it, Dustin Diaz has written this excellent parody on what the hottest web techniques were like before webstandards and css were invented.
Seven hottest web 1.0 techniques to trick out your webpage.
2) Animation without JavaScript
Believe it! It’s true. Drop those old scripts that made your website scroll and blink because why bother [...]]]></description>
			<content:encoded><![CDATA[<p>In case you missed it, Dustin Diaz has written this excellent parody on what the hottest web techniques were like before webstandards and css were invented.<br />
<a href="http://www.dustindiaz.com/web-1-point-oh-techniques/" title="Dustin Diaz: &quot;Seven hottest web 1.0 techniques to trick out your webpage&quot;">Seven hottest web 1.0 techniques to trick out your webpage</a>.</p>
<blockquote cite="http://www.dustindiaz.com/web-1-point-oh-techniques/"><h3>2) Animation without JavaScript</h3>
<p>Believe it! It’s true. Drop those old scripts that made your website scroll and blink because why bother programming JavaScript when plain ‘ol HTML can do it for you! These are the ever-so-beloved
<div class="codesnip-container" >&lt;blink&gt;</div>
<p> and
<div class="codesnip-container" >&lt;marquee&gt;</div>
<p> tags.</p>
<h3 class="code">blink and marquee</h3>
<pre animheight="60">
<div class="codesnip-container" >&lt;blink&gt;Sale! Sale! Sale! Buy now and save big!&lt;/blink&gt;

&lt;marquee&gt;Welcome welcome welcome! Today is the beginning of the end, buy now!&lt;/marquee&gt;</div>
</pre>
</blockquote>
<p>Fabulous humour, just the way I like it :). Especially I love the hit counter:</p>
<p><img src="http://www.dustindiaz.com/basement/web-1.0/hitstoday.gif" alt="Hits today"/></p>
<p>Oh and by the way, did you know who <a href="http://justaddwater.dk/2006/03/03/who-invented-the-spacergif/">invented the spacer.gif</a>?</p>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/spacer.gif" rel="tag">spacer.gif</a>, <a href="http://technorati.com/tag/webstandards" rel="tag"> webstandards</a>, <a href="http://technorati.com/tag/" rel="tag"> </a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/12/06/1996-humour-ahead-spacergif-table-layouts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Run JavaScript From Watir Scripts</title>
		<link>http://justaddwater.dk/2007/11/20/how-to-run-javascript-from-watir-scripts/</link>
		<comments>http://justaddwater.dk/2007/11/20/how-to-run-javascript-from-watir-scripts/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 20:12:20 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/11/20/how-to-run-javascript-from-watir-scripts/</guid>
		<description><![CDATA[What&#8217;s Watir? Read &#8220;Watir: Another sweetspot for Enterprise Ruby&#8221;
Is it possible to run JavaScript functions or execute code from within your Watir test scripts?  As a matter of fact it is, but I had a hard time finding the proper documentation for it.  Here is what to do and how:
Call JavaScript Functions from [...]]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s Watir? Read &#8220;<a href="http://justaddwater.dk/2006/07/14/watir-sweetspot-enterprise-ruby/">Watir: Another sweetspot for Enterprise Ruby</a>&#8221;</p>
<p>Is it possible to run JavaScript functions or execute code from within your Watir test scripts?  As a matter of fact it is, but I had a hard time finding the proper documentation for it.  Here is what to do and how:</p>
<h3>Call JavaScript Functions from Watir script</h3>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;">win = ie.<span class="me1">document</span>.<span class="me1">parentWindow</span><br />
win.<span class="me1">ToggleProj</span><span class="br0">&#40;</span><span class="st0">&#8216;1&#8242;</span><span class="br0">&#41;</span></div>
</div>
<h3>Inject JavaScript  to run from Watir script</h3>
<p>I used this to alter a JavaScript function on the existing page:</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;"><span class="re1">@ie</span>.<span class="me1">document</span>.<span class="me1">parentWindow</span>.<span class="kw3">eval</span><span class="br0">&#40;</span><span class="st0">&#8216;<br />
&nbsp; window.CheckReport=function(){return true}&#8217;</span><span class="br0">&#41;</span></div>
</div>
<p>As you can see, you can reference the window object and use eval to execute your snippets. The easier way is to add this custom method for easy reference</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;"><span class="co1"># Add accessor for DOM window object</span><br />
<span class="kw1">class</span> <span class="re2">Watir::IE</span>; <span class="kw1">def</span> window; document.<span class="me1">parentWindow</span>; <span class="kw1">end</span>; <span class="kw1">end</span></div>
</div>
<p>Then you can write the last example as:</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;"><span class="re1">@ie</span>.<span class="me1">window</span>.<span class="kw3">eval</span><span class="br0">&#40;</span><span class="st0">&#8216;<br />
&nbsp; window.CheckReport=function(){return true}&#8217;</span><span class="br0">&#41;</span></div>
</div>
<p>Much more intuitive and straightforward. Thanks to my colleague <a href="http://tobiashm.jaiku.com/">Tobias</a> for the trick.</p>
<p>More info</p>
<ul>
<li>Justaddwater.dk: <a href="http://justaddwater.dk/2006/07/14/watir-sweetspot-enterprise-ruby/" rel="bookmark" title="Permanent Link: Watir: Another sweetspot for Enterprise Ruby">Watir: Another sweetspot for Enterprise Ruby</a> (July 2006)</li>
<li>Telerik (by Egil): <a href="http://blogs.telerik.com/blogs/twisted_asp_net/archive/2006/04/26/201.aspx">Automating Complex JavaScript-rich Controls with Watir</a> (April 2006)</li>
<li><a href="http://dwatir.rubyforge.org/">DWatir</a> for distributed testing is very promising. I saw the demo at RailsConf but had not yet a chance to use. More info in the <a href="http://dwatir.rubyforge.org/svn/trunk/lib/dwatir.rb">code files</a>.
</li>
</ul>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>, <a href="http://technorati.com/tag/enterprise" rel="tag"> enterprise</a>, <a href="http://technorati.com/tag/business+case" rel="tag"> business case</a>, <a href="http://technorati.com/tag/watir" rel="tag"> watir</a>, <a href="http://technorati.com/tag/testing" rel="tag"> testing</a>, <a href="http://technorati.com/tag/javascript" rel="tag"> javascript</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/11/20/how-to-run-javascript-from-watir-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox Tip For Framebuster JavaScript</title>
		<link>http://justaddwater.dk/2007/10/22/firefox-tip-for-framebuster-javascript/</link>
		<comments>http://justaddwater.dk/2007/10/22/firefox-tip-for-framebuster-javascript/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 11:30:06 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/10/22/firefox-tip-for-framebuster-javascript/</guid>
		<description><![CDATA[I have for long been struggling with an internal legacy application that wraps the content page in a frameset. Very annoying because I have spent some time to reverse engineer a poor-mans API to the application.
Problem: An inline &#8220;reverse&#8221; framebuster script that makes sure that everything is nicely(?) wrapped in the frameset.  As you [...]]]></description>
			<content:encoded><![CDATA[<p>I have for long been struggling with an internal legacy application that wraps the content page in a frameset. Very annoying because I have spent some time to reverse engineer a poor-mans API to the application.</p>
<p>Problem: An inline &#8220;reverse&#8221; framebuster script that makes sure that everything is nicely(?) wrapped in the frameset.  As you see it&#8217;s included inline in the HTML.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="sy0">&lt;</span>script Language<span class="sy0">=</span><span class="st0">&quot;Javascript&quot;</span><span class="sy0">&gt;</span><br />
&nbsp; url <span class="sy0">=</span> <span class="st0">&quot;application_url&quot;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>parent.<span class="me1">frames</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>parent.<span class="me1">frames</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span>.<span class="kw3">name</span> <span class="sy0">!=</span> <span class="st0">&#8216;FrameMain&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; document.<span class="me1">location</span>.<span class="me1">replace</span><span class="br0">&#40;</span>url<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; document.<span class="me1">location</span>.<span class="me1">replace</span><span class="br0">&#40;</span>url<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="sy0">&lt;/</span>script<span class="sy0">&gt;</span></div>
</div>
<p>One thing is I never understood the thing about putting everything in a frameset. In this case, I have not been able to change the code. But as I have to use the application every now and then, the big question is:</p>
<p><strong>How to change or remove the inline JavaScript, and make sure the framebuster is ignored?</strong></p>
<p>I did not think this was possible until I got this answer from &#8220;esquifit&#8221; in the <a href="http://groups.google.com/group/greasemonkey-users">Greasemonkey user goup</a>:</p>
<blockquote cite="http://groups.google.com/group/greasemonkey-users/browse_thread/thread/42a64be1aa31e1d8/76df7564697e076a#76df7564697e076a"><p>You do not need GM nor Opera for this task.  Firefox comes with a<br />
built-in capability for allowing/disallowing access to<br />
properties/methods of DOM Objects on a per-site basis. It is called<br />
Configurable Security Policies (CAPS) and it is described in [1].<br />
Further examples and explanations are provided for example in [2] and<br />
[3].<br />
A short guide assuming the simplest case:<br />
1) Close Firefox<br />
2) Locate your profile folder [4]<br />
3) Locate the file user.js within this folder. If it does not exist,<br />
create it with a *text* editor (Notepad, vim, etc.), not with a &#8216;word<br />
processor&#8217; (MS Word, OpenOffice.org, Wordpad, etc.)<br />
4) Add the following lines to user.js:<br />
user_pref(&#8220;capability.policy.policynames&#8221;, &#8220;noframebuster&#8221;);<br />
user_pref(&#8220;capability.policy.noframebuster.sites&#8221;,<br />
&#8220;<a href="http://www.annoying-site.com/" target="_blank" rel="nofollow">http://www.annoying-site.com</a>&#8220;);<br />
user_pref(&#8220;capability.policy.noframebuster.Location.replace&#8221;, &#8220;noAccess&#8221;);<br />
Of course, you will have to replace the domain with the one you want to prevent from redirecting your frames.</p></blockquote>
<p>Find the entire discussion here:</p>
<ul>
<li>Greasemonkey users group: &#8220;<a href="http://groups.google.com/group/greasemonkey-users/browse_thread/thread/42a64be1aa31e1d8/76df7564697e076a#76df7564697e076a">How to ignore framebuster script</a>&#8220;</li>
</ul>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a>, <a href="http://technorati.com/tag/frameset" rel="tag"> frameset</a>, <a href="http://technorati.com/tag/frames" rel="tag"> frames</a>, <a href="http://technorati.com/tag/frame+buster" rel="tag"> frame buster</a>, <a href="http://technorati.com/tag/inline" rel="tag"> inline</a>, <a href="http://technorati.com/tag/firefox" rel="tag"> firefox</a>, <a href="http://technorati.com/tag/location.replace" rel="tag"> location.replace</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/10/22/firefox-tip-for-framebuster-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Web Site Investigation Toolbox Update</title>
		<link>http://justaddwater.dk/2007/10/12/web-site-investigation-toolbox-update/</link>
		<comments>http://justaddwater.dk/2007/10/12/web-site-investigation-toolbox-update/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 08:54:01 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/10/12/web-site-investigation-toolbox-update/</guid>
		<description><![CDATA[<img src="http://justaddwater.dk/wp-content/uploads/2007/10/bookmarlets.thumbnail.png" alt="bookmarlets.png" style="float:left; margin-right:10px;"/> I figured the original bookmarklet toolbox needed an update. Added Quirksmode detection, layout grid and updated PageInfo to accept framed pages. <br style="clear:left"/>]]></description>
			<content:encoded><![CDATA[<p>I figured the original bookmarklet toolbox needed an update (i have updated and added a few bookmarklets since I first posted <a href="http://justaddwater.dk/2006/09/18/toolbox/" rel="bookmark" title="Permanent Link: Toolbox — locating problems in HTML">Toolbox — locating problems in HTML</a>). Quirksmode detection, Layout grid and more.</p>
<p>For example I added &#8220;quirks or !quirks&#8221; to determine whether a page runs standards mode or quirks mode. It pops up an alert that displays rendering mode for each frame.</p>
<ul>
<li>&#8220;Document mode: CSS1 Compat&#8221; is standards mode</li>
<li>&#8220;Document mode: Back compat&#8221; is quirksmode</li>
</ul>
<p>I forget where I found the code (please notify me and I&#8217;ll give you credit).I also modified <a href="http://slayeroffice.com/?c=/content/tools/pagenfo.html">Steve Chipman&#8217;s excellent &#8220;PageInfo&#8221;</a> so that its usable with frames. If frames are found it asks you to enter a frame number (index from document.frames[x])</p>
<p>I also added Andy Budd&#8217;s <a href="www.andybudd.com/archives/2006/07/layout_grid_bookmarklet/">CSS grid layout bookmarklet</a> which I find useful on occasions to see if things line up.</p>
<p>In general I find that I use these less and less, because much functionality is built into Firebug. But on some occations the bookmarklets can prove very handy.</p>
<p>Import all at once (separate HTML page):</p>
<p style="text-align: center"><strong><a href="http://justaddwater.dk/wp-content/uploads/2007/10/web-standards-investigation-tools.html" id="p394">Web Standards Investigation Tools (WSIT)  HTML page</a></strong><br />
<small>(last updated 2007-10-12)</small>
</p>
<p style="text-align: center"><img src="http://justaddwater.dk/wp-content/uploads/2007/10/bookmarlets.png" alt="bookmarlets.png" /></p>
<p>Instruction:</p>
<ol>
<li>Save the linked HTML page locally</li>
<li>Open Firefox Bookmark Manager (Bookmarks &gt; Manage Bookmarks)</li>
<li>Choose File &gt; Import …</li>
<li>Import bookmarks into “Bookmarks Toolbar Folder” for easy access to them.</li>
</ol>
<p>More info:</p>
<ul>
<li><a href="http://justaddwater.dk/2006/09/18/toolbox/" rel="bookmark" title="Permanent Link: Toolbox — locating problems in HTML">Toolbox — locating problems in HTML</a></li>
<li>Original <a href="http://justaddwater.dk/2006/06/29/webstandards-case-study/">Web Standards Investigation Tools (WSIT) bookmarklets</a> (September 2006)</li>
<li><a href="http://justaddwater.dk/2006/09/18/technique">Technique for locating problems in HTML</a> (September 2006)</li>
<li><a href="http://justaddwater.dk/2006/06/29/webstandards-case-study/">Why web standards matter (case study) (June 2006)</a></li>
</ul>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a>, <a href="http://technorati.com/tag/bookmarklet" rel="tag"> bookmarklet</a>, <a href="http://technorati.com/tag/toolbox" rel="tag"> toolbox</a>, <a href="http://technorati.com/tag/webstandards" rel="tag"> webstandards</a>, <a href="http://technorati.com/tag/web+standards" rel="tag"> web standards</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/10/12/web-site-investigation-toolbox-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>E-Texteditor For Windows</title>
		<link>http://justaddwater.dk/2007/04/28/e-texteditor-for-windows/</link>
		<comments>http://justaddwater.dk/2007/04/28/e-texteditor-for-windows/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 22:55:38 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/04/28/e-texteditor-for-windows/</guid>
		<description><![CDATA[I have been looking a fast, intuitive editor for my Windows laptop.
Now I stopped looking. E-texteditor for windows is very intuitive and easy to use.  I highly recommend watching the screencast (a short tour of some of the best features). Although it&#8217;s still in beta, it seems so much better than the alternatives.
I&#8217;m using [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking a fast, intuitive editor for my Windows laptop.</p>
<p>Now I stopped looking. E-texteditor for windows is very intuitive and easy to use.  I highly recommend watching the screencast (a short tour of some of the best features). Although it&#8217;s still in beta, it seems so much better than the alternatives.</p>
<p>I&#8217;m using it for HTML, CSS, JavaScript, Ruby on Rails editing. And it just works.</p>
<p><a href="http://www.e-texteditor.com/index.html" title="E-texteditor homepage with screenshot"><img src="http://justaddwater.dk/wp-content/uploads/2007/04/e-texteditor-homepage.png" alt="e-texteditor-homepage.png" /></a></p>
<p>One note for avoiding future head-scratching: In order to get the keyboard shortcuts (so-called bundles) to work, I had to delete Cygwin and let E install it automatically. Afterwards I had to add packages manually: Subversion (svn)</p>
<p>Other improvements that would be handy:<br />
In HTML mode there is a shortcut &#8220;doctype [tab]&#8220;, but there is no shortcut for creating the rest of the HTML document. It&#8217;s probably easy to add (but  i&#8217;m not into doing it yet). Besides, I think an addition like this would be a benefit to everybody, so it should be included in the general bundle.</p>
<p>In Ruby files, when looking on Ruby on Rails, it defaults the files to Ruby (because they are and they end in .rb). However, there is a lot of functionality with regards to Rails, so it would actually work better, if .rb defaulted to Ruby. Here is a <a href="http://www.e-texteditor.com/forum/viewtopic.php?p=3361#3361" title="E-texteditor forum: Set Rails file from Ruby to Rails">workaround to add .rb files to Rails syntax</a>.</p>
<p>I also added a bug report &#8220;<a href="http://www.e-texteditor.com/forum/viewtopic.php?t=1120" title="E-Texteditor forum">Block selection should work without the mouse</a>&#8221; (guess I&#8217;m a usability geek).</p>
<p>The simple <a href="http://cheat.errtheblog.com/s/e/" title="ErrTheBlog E-texteditor cheatsheet.">cheatsheet for E-texteditor</a> at errtheblog is worth checking out, although it contains only the general shortcuts and not the Rails specific ones. Via: <a href="http://www.rubyinside.com/e-texteditor-a-windows-textmate-or-why-apple-should-buy-textmate-413.html" rel="bookmark" title="RubyInside: E-TextEditor: A Windows TextMate? (Or ">RubyInside</a>.</p>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/editor" rel="tag">editor</a>, <a href="http://technorati.com/tag/e-texteditor" rel="tag"> e-texteditor</a>, <a href="http://technorati.com/tag/etexteditor" rel="tag"> etexteditor</a>, <a href="http://technorati.com/tag/windows" rel="tag"> windows</a>, <a href="http://technorati.com/tag/textmate" rel="tag"> textmate</a>, <a href="http://technorati.com/tag/html" rel="tag">  html</a>, <a href="http://technorati.com/tag/css" rel="tag"> css</a>, <a href="http://technorati.com/tag/javascript" rel="tag"> javascript</a>, <a href="http://technorati.com/tag/rails" rel="tag"> rails</a>, <a href="http://technorati.com/tag/ruby+on+rails" rel="tag"> ruby on rails</a>, <a href="http://technorati.com/tag/ruby" rel="tag"> ruby</a>, <a href="http://technorati.com/tag/rubyonrails" rel="tag"> rubyonrails</a>, <a href="http://technorati.com/tag/cygwin" rel="tag"> cygwin</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/04/28/e-texteditor-for-windows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Handy JavaScript Cookie Editor</title>
		<link>http://justaddwater.dk/2007/01/29/javascript-cookie-editor-bookmarklet/</link>
		<comments>http://justaddwater.dk/2007/01/29/javascript-cookie-editor-bookmarklet/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 22:50:49 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[justaddwater.dk]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2007/01/29/javascript-cookie-editor-bookmarklet/</guid>
		<description><![CDATA[2 years ago I wrote a small javascript to view, edit and delete cookies. 
The really cool thing about this user interface is the inline editing of cookie names and values. I really like the principle that you hover the value that you inspect, can see that it&#8217;s editable. Then click directly and the text [...]]]></description>
			<content:encoded><![CDATA[<p>2 years ago I wrote a small javascript to view, edit and delete cookies. </p>
<p>The really cool thing about this user interface is the <strong>inline editing of cookie names and values</strong>. I really like the principle that you hover the value that you inspect, can see that it&#8217;s editable. Then click directly and the text is converted to a text field that is automatically saved when you leave the field.</p>
<p>Andrei from New York wrote me and reminded me the handy little cookie editor, so after making some minor modifications, I decided to republish it.</p>
<p>Well, actually, I&#8217;ve spent some hours getting more and more puzzled on some bugs and limitations in the code. </p>
<p>I won&#8217;t hesitate anymore, but rather give you the tool including some known issues. Please feel free to make suggestions or fix.</p>
<h3>Known issues:</h3>
<p>All cookies set with the tool expires end-of-session. This could be easily fixed, but I&#8217;d like to implement it in a way so that it works elegantly and simple in the user interface.</p>
<p>Cookies with domain set differently cannot be edited or deleted. This is a problem on many big portal sites. For instance, all cookies on Yahoo! are set for
<div class="codesnip-container" >.yahoo.com</div>
<p>. But the front-page is located at
<div class="codesnip-container" >www.yahoo.com</div>
<p> (the www subdomain of yahoo.com), which means that my tool is not allowed to edit or remove the cookie.</p>
<p><strong>Goto next page and bookmark this link in your browser: <a id="p526" href="http://justaddwater.dk/wp-content/uploads/2007/01/cookieeditor.html" title="cookieeditor.html">cookie editor page with bookmarklet</a>.</strong></p>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a>, <a href="http://technorati.com/tag/bookmarklet" rel="tag"> bookmarklet</a>, <a href="http://technorati.com/tag/favelet" rel="tag"> favelet</a>, <a href="http://technorati.com/tag/cookie+editor" rel="tag"> cookie editor</a>, <a href="http://technorati.com/tag/cookies" rel="tag"> cookies</a>, <a href="http://technorati.com/tag/editor" rel="tag"> editor</a>, <a href="http://technorati.com/tag/cookie" rel="tag"> cookie</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2007/01/29/javascript-cookie-editor-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The IE PNG fix vs. Accessibility</title>
		<link>http://justaddwater.dk/2006/11/06/the-ie-png-fix-vs-accessibility/</link>
		<comments>http://justaddwater.dk/2006/11/06/the-ie-png-fix-vs-accessibility/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 13:08:45 +0000</pubDate>
		<dc:creator>Thomas Watson Steen</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2006/11/06/the-ie-png-fix-vs-accessibility/</guid>
		<description><![CDATA[It is no secret that all versions of Internet Explorer on Windows prior to version 7.0 has a flaw in its PNG renderer. The flaw basically involves the rendering of the alpha transparency and means that the images cannot fade nicely into the background.
The IE PNG bug explained
In the screenshots below you can see the [...]]]></description>
			<content:encoded><![CDATA[<p>It is no secret that all versions of Internet Explorer on Windows prior to version 7.0 has a flaw in its PNG renderer. The flaw basically involves the rendering of the alpha transparency and means that the images cannot fade nicely into the background.</p>
<h3>The IE PNG bug explained</h3>
<p>In the screenshots below you can see the same image as it is seen in Internet Explorer 6 and Internet Explorer 7 <small>(Gray border added around the edge of the screenshot for your viewing pleasure)</small>:</p>
<p><img src="http://justaddwater.dk/wp-content/uploads/2006/11/png-alpha-trans2.png" title="Screenshot of IE6 png bug" alt="Screenshot of IE6 png bug" /><br />
<small>PNG alpha transparency bug as seen in IE6</small></p>
<p><img src="http://justaddwater.dk/wp-content/uploads/2006/11/png-alpha-trans-fixed2.png" title="Screenshot of IE6 png bug fixed" alt="Screenshot of IE6 png bug fixed" /><br />
<small>No PNG alpha transparency bug as seen in IE7</small></p>
<p>Instead of showing what is truly behind the image all IE renderer&#8217;s prior to IE 7 just shows an ugly, bluish/gray background color.</p>
<h3>The solution and a new problem</h3>
<p>Several people have found solutions to this problem. Most noticeably is <a href="http://homepage.ntlworld.com/bobosola/" title="The PNG problem in Windows Internet Explorer">the fix by Bob Osola</a> where I have also borrowed the above examples.</p>
<p><strong>There is one problem though with these kind of fixes, and that problem is accessibility.</strong></p>
<p>The idea is that you embed a piece of JavaScript in your webpage that, just before the images are displayed, runs through the DOM and replaces any img element that display a PNG image with a span element. What&#8217;s special about this span element is that it has a style attribute with a special IE-only filter called:</p>
<div class="codesnip-container" >DXImageTransform.Microsoft.AlphaImageLoader</div>
<p>This filter then renders the original image inside the span element and the user sees the image as if it was just a regular img element.</p>
<p>But what about screen readers? Will they still recognize this as a regular image? Some may say that screen readers don&#8217;t use JavaScript anyway and therefore never gets their DOM changed. But the most popular screen reader of them all for Windows called <a href="http://www.freedomscientific.com/fs_products/software_jaws.asp">JAWS</a> is just a regular Windows program running next to the browser and just reads whatever code the browser holds.</p>
<p><strong>Does anybody have any thoughts or experience with this? Am I for example right in my assumption that JAWS actually reads the generated code? And will that in fact be a problem? Please drop a comment with your thoughts.</strong></p>
<p><ins>Update 2006-11-06 19:10 (CET)</ins><br />
To better understand the accessibility implications, here is an update to clarify what Bob Osolas fix actually does. Take this example of a regular img element:</p>
<p><code style="text-align: left">&lt;img src="<b>/images/sunset.png</b>" align="<b>left</b>" alt="<b>Sunset over New York</b>" width="<b>654</b>" height="<b>321</b>" id="<b>img421</b>" class="<b>largeimage</b>" style="<b>border: 1px solid black</b>" /&gt;</code></p>
<p>That is then translated into this span element:</p>
<p><code style="text-align: left">&lt;span id="<b>img421</b>" class="<b>largeimage</b>" title="<b>Sunset over New York</b>" style="width:<b>654</b>px; height:<b>321</b>px; float:<b>left</b>; display:inline-block; <b>border: 1px solid black</b>; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<b>/images/sunset.png</b>', sizingMethod='scale');"&gt;&lt;/span&gt;</code></p>
<p>In turn if the original img element is wrapped in an a element (i.e. is linkable) the following css is also added to the style attribute of the span element:</p>
<div class="codesnip-container" >cursor:hand;</div>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/Internet+Explorer" rel="tag">Internet Explorer</a>, <a href="http://technorati.com/tag/IE" rel="tag"> IE</a>, <a href="http://technorati.com/tag/IE6" rel="tag"> IE6</a>, <a href="http://technorati.com/tag/IE7" rel="tag"> IE7</a>, <a href="http://technorati.com/tag/png+fix" rel="tag"> png fix</a>, <a href="http://technorati.com/tag/images" rel="tag"> images</a>, <a href="http://technorati.com/tag/accessibility" rel="tag"> accessibility</a>, <a href="http://technorati.com/tag/screen+reader" rel="tag"> screen reader</a>, <a href="http://technorati.com/tag/JAWS" rel="tag"> JAWS</a>, <a href="http://technorati.com/tag/DOM" rel="tag"> DOM</a>, <a href="http://technorati.com/tag/HTML" rel="tag"> HTML</a>, <a href="http://technorati.com/tag/JavaScript" rel="tag"> JavaScript</a>, <a href="http://technorati.com/tag/web+development" rel="tag"> web development</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2006/11/06/the-ie-png-fix-vs-accessibility/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Toolbox &#8212; locating problems in HTML</title>
		<link>http://justaddwater.dk/2006/09/18/toolbox/</link>
		<comments>http://justaddwater.dk/2006/09/18/toolbox/#comments</comments>
		<pubDate>Mon, 18 Sep 2006 20:35:58 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/2006/09/18/toolbox/</guid>
		<description><![CDATA[I decided to make a little toolbox that&#8217;s easy to apply on web pages, when investigating problems with web pages. Basically, it&#8217;s the tools I used when investigating the case I described in  &#8220;Why web standards matter (case study)&#8221;
I decided to split this into two posts. This first one is about the toolbox. The [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to make a little toolbox that&#8217;s easy to apply on web pages, when investigating problems with web pages. Basically, it&#8217;s the tools I used when investigating the case I described in  &#8220;<a href="http://justaddwater.dk/2006/06/29/webstandards-case-study/">Why web standards matter (case study)</a>&#8221;</p>
<p>I decided to split this into two posts. This first one is about the toolbox. The second part is about the <a href="http://justaddwater.dk/2006/09/18/technique">investigation technique</a> (available separately).</p>
<h3>Firefox Extensions for the toolbox</h3>
<p>I use Firefox for the investigation. It has the best web developer tools and bookmarklet support. <a href="http://www.getfirefox.com">Get firefox</a>.</p>
<ol>
<li><a href="http://users.skynet.be/mgueury/mozilla/">HTML Validator (based on Tidy)</a>. HTML validation errors and warnings immediately in the status bar on the page you watch. Indispensible when aiming for standards compatible websites.</li>
<li><a href="http://www.joehewitt.com/software/firebug/">Firebug</a>. JavaScript errors and warnings immediately in the status bar. </li>
<li>Firefox <a href="http://www.chrispederick.com/work/webdeveloper/">Web Developer Toolbar</a>. Has a lot of handy tools, among others the ability to turn off CSS stylesheets.</li>
</ol>
<p>For a more indepth description of Firefox extensions, refer to my previous post from last year: <a href="http://justaddwater.dk/2005/11/30/web-developers-collection-of-browser-tools">Web developer&#8217;s collection of browser tools</a>.</p>
<h3>JavaScript bookmarklets</h3>
<p>Bookmarklets are small JavaScript snippets, that is stored as a bookmark and executed on any page. I prepared a collection useful for investigating web standards issues.</p>
<p>Import all at once (separate HTML page):</p>
<p style="text-align:center"><strong><a id="p394" href="http://justaddwater.dk/wp-content/uploads/2006/09/web-standards-investigation-tools.html">Web Standards Investigation Tools (WSIT)  HTML page</a></strong><br /><small>(last updated 2006-09-18)</small></p>
<p>Instruction: </p>
<ol>
<li>Save the linked HTML page locally</li>
<li>Open Firefox Bookmark Manager (Bookmarks &gt; Manage Bookmarks) </li>
<li>Choose File &gt; Import &hellip; </li>
<li>Import bookmarks into &#8220;Bookmarks Toolbar Folder&#8221; for easy access to them.</li>
</ol>
<p>The bookmark above contains the following bookmarklets. I list them with a &#8220;shortname&#8221; </p>
<ol>
<li><strong>Page Info</strong> (contains key figures about content to markup ratio, total code weight and number of image elements. Shortname: pInfo</li>
<li><strong>Mouse Over DOM Inspector 2</strong>. Turned on, you simply hover any element to learn about  attributes, children and ancestors. Probably the easiest way to investigate a HTML page. Shortname: modi2</li>
<li><strong>JavaScript Shell</strong>. Opens a JavaScript Shell and allows it to access the current page. Shortname: Shell</li>
</ol>
<p>A few other bookmarklets that I use frequently for furthter investigations, but they are not used in my description.</p>
<ol start="4">
<li><strong>JavaScript Variables</strong>. Displays all JavaScript variables and functions. Shortname: JS vars</li>
<li><strong>Cookie editor</strong>. View, delete and edit cookies. (Will be available later due to a server crash).</li>
<li><strong>Table number rows</strong>. Numbers each table row (makes it easy to see if tables are used for layout). Shortname: Trow</li>
</ol>
<h3>More info about the bookmarklets.</h3>
<p><a href="http://slayeroffice.com/?c=/content/tools/pagenfo.html" title="Slayeroffice.com: Page Info">Page Info</a> and <a href="http://slayeroffice.com/tools/modi/v2.0/modi_help.html" title="Slayeroffice.com: MODI2">Mouse Over DOM inspector</a> are part of Steve Chipman&#8217;s bookmarklet collection &#8220;<a href="http://slayeroffice.com/?c=/content/tools/suite.html" title="Slayeroffice.com: Favelet Suite">Favelet Suite</a>&#8221; which is definately worth a mention. </p>
<p>JavaScript Shell, JS Variables and Table number row are from Jesse Ruderman&#8217;s indispensable <a href="http://squarefree.com/bookmarklets/">webdevelopers bookmarklet collection</a> (which you can <a href="http://squarefree.com/bookmarklets/importall.html">download as one file</a>)</p>
<p>The Cookie editor is my own invention. Will be available later as I will move it to a new server. </p>
<h3>Summary</h3>
<p>These are the basic tools that have been helpful for me when investigating web standards related issues in web pages. The toolbox here is complimented with the page describing the technique for locating problems in HTML.</p>
<p>Related reading:</p>
<ul>
<li><a href="http://justaddwater.dk/2006/09/18/technique">technique for locating problems in HTML</a></li>
<li><a href="http://justaddwater.dk/2006/06/29/webstandards-case-study/">Why web standards matter (case study)</a></li>
</ul>
<p><small>Technorati Tags: <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a>, <a href="http://technorati.com/tag/bookmarklet" rel="tag"> bookmarklet</a>, <a href="http://technorati.com/tag/toolbox" rel="tag"> toolbox</a>, <a href="http://technorati.com/tag/webstandards" rel="tag"> webstandards</a>, <a href="http://technorati.com/tag/web+standards" rel="tag"> web standards</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2006/09/18/toolbox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
