<?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"
	>

<channel>
	<title>Web 3.0, 6 Bladed Razors, 7 Minute Abs &#187; Web Browsers</title>
	<atom:link href="http://www.zachleat.com/web/category/web-browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web</link>
	<description></description>
	<pubDate>Thu, 21 Aug 2008 06:02:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Don&#8217;t Let the Door Hit You Onunload and Onbeforeunload</title>
		<link>http://www.zachleat.com/web/2008/04/22/dont-let-the-door-hit-you-onunload-and-onbeforeunload/</link>
		<comments>http://www.zachleat.com/web/2008/04/22/dont-let-the-door-hit-you-onunload-and-onbeforeunload/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 04:51:08 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[Interface Design]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Gmail]]></category>

		<category><![CDATA[Opera]]></category>

		<category><![CDATA[Undo]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/?p=126</guid>
		<description><![CDATA[Many people attempt a last ditch effort to save page state in the browser by using the onunload or onbeforeunload events.  This has been studied at great length by Patrick Hunlock,  who uses the perhaps now common knowledge of using a Synchronous Ajax call to perform the page state save.
Another use for the [...]]]></description>
			<content:encoded><![CDATA[<p>Many people attempt a last ditch effort to save page state in the browser by using the onunload or onbeforeunload events.  This has been studied at great length by <a href="http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript">Patrick Hunlock</a>,  who uses the perhaps now common knowledge of using a Synchronous Ajax call to perform the page state save.</p>
<p>Another use for the onbeforeunload event to allow the user to cancel the action that initiated the user leaving in the first place.  Gmail uses this technique when the user is in the middle of writing a draft of an e-mail and attempts to leave the page.</p>
<p><a href='http://www.zachleat.com/web/wp-content/uploads/2008/04/gmail-confirm.png'><img src="http://www.zachleat.com/web/wp-content/uploads/2008/04/gmail-confirm.png" alt="" title="gmail-confirm" width="455" height="157" class="aligncenter size-full wp-image-129" /></a><br />
<em>Gmail's pops up this prompt when the user attempts to leave the page while drafting an email.</em></p>
<p>Worthy to note, however, is that Opera <a href="http://www.quirksmode.org/bugreports/archives/2004/11/load_and_unload.html">doesn't fire the unload event</a> when the browser refreshes the page, or uses the back/forward buttons to browse off of the page (I had no success with the fix posted in the comments on that page).  What's worse, Opera never fires the onbeforeunload event.  This creates a serious problem with attempting to save page state prior to a user leaving your page.</p>
<p>Browser support aside, I believe that the onbeforeunload prompt is not an ideal way to protect the user from lost work (or unsaved page state).  Humanized has argued, and I agree, that <a href="http://www.alistapart.com/articles/neveruseawarning">an undo operation is much easier on the end user than a warning message</a>.  The strange thing is, Gmail could save the draft in a synchronous Ajax request in the onunload event.  They aren't using the prompt to save Opera users from losing their drafts, since the Opera web browser doesn't even fire the onbeforeunload event.  (Interestingly enough, they are using some sort of browser history management to fire a warning to the user when they press back, or forward, in Opera -- but Reload can't be caught using this method, so your could draft email be lost).</p>
<p>From a User Interface design standpoint, I would recommend just sticking with onunload.  You can still perform your synchronous Ajax call in the method to save the state of your page, so that the user can later resume their state or undo the operation. (Except for Back/Forward/Refresh in Opera, until they support a better onunload or any onbeforeunload).  The onbeforeunload prompt is an unnecessary evil, and doesn't do much besides annoy the end user with another warning message and a mouse click.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/JavaScript" rel="tag">JavaScript</a>, <a href="http://technorati.com/tag/onunload" rel="tag"> onunload</a>, <a href="http://technorati.com/tag/onbeforeunload" rel="tag"> onbeforeunload</a>, <a href="http://technorati.com/tag/Ajax" rel="tag"> Ajax</a>, <a href="http://technorati.com/tag/Undo" rel="tag"> Undo</a>, <a href="http://technorati.com/tag/Opera" rel="tag"> Opera</a>, <a href="http://technorati.com/tag/Gmail" rel="tag"> Gmail</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2008/04/22/dont-let-the-door-hit-you-onunload-and-onbeforeunload/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Minor Annoyances with Firefox Development</title>
		<link>http://www.zachleat.com/web/2008/03/23/minor-annoyances-with-firefox-development/</link>
		<comments>http://www.zachleat.com/web/2008/03/23/minor-annoyances-with-firefox-development/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 20:39:40 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Caching]]></category>

		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/minor-annoyances-with-firefox-development/</guid>
		<description><![CDATA[When you're developing web applications in Firefox, do you find yourself constantly clearing your cache?  Cache is a useful facet of web browsing for everything but the continuous testing environment of web development.  Here's a nice alternative so that you don't have to disable your cache entirely:
Use the Firefox Plug-In called (humorously enough) [...]]]></description>
			<content:encoded><![CDATA[<p>When you're developing web applications in Firefox, do you find yourself constantly clearing your cache?  Cache is a useful facet of web browsing for everything but the continuous testing environment of web development.  Here's a nice alternative so that you don't have to disable your cache entirely:</p>
<p>Use the Firefox Plug-In called (humorously enough) <a href="https://addons.mozilla.org/en-US/firefox/addon/3817"><strong>JohnnyCache</strong></a>.  I added the pattern 'http://localhost/' to my preferences and now I don't have to worry about cache on my local machine anymore.  Simple, easy, effective.</p>
<p>Now only if I knew how to disable the Firefox preference that autopopulates form fields with default values when F5 is hit to refresh the page.  Try creating a page with a single text field, type a value into the form, and then hit F5 to refresh the page.  Your value will be prefilled into the form.</p>
<p>I find myself always hitting "CTRL+L" (goes to the Location Bar) and "Enter" to avoid that one.  I looked through about:config, but only found: signon.prefillForms (related to usernames and passwords), and browser.formfill.enable (related to autocomplete dropdowns for forms, not default values).</p>
<p>Anyone know an easier method?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2008/03/23/minor-annoyances-with-firefox-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Problems with Looping through window.setInterval</title>
		<link>http://www.zachleat.com/web/2007/12/23/problems-with-looping-through-windowsetinterval/</link>
		<comments>http://www.zachleat.com/web/2007/12/23/problems-with-looping-through-windowsetinterval/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 03:46:24 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Timers]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/12/23/problems-with-looping-through-windowsetinterval/</guid>
		<description><![CDATA[Look at this code.  What do you expect to be the outcome?



var d = new Date&#40;&#41;;
var r = &#91;&#93;;
for&#40;var j=0,k=2;j&#60;k ;j++&#41; &#123;
&#160; &#160; window.setInterval&#40;function&#40;&#41;
&#160; &#160; &#123;
&#160; &#160; &#160; &#160; var next = new Date&#40;&#41;;
&#160; &#160; &#160; &#160; r.push&#40;next.getTime&#40;&#41; - d.getTime&#40;&#41;&#41;;
&#160; &#160; &#125;,1000&#41;;
&#125;



Every 1000 milliseconds (1 second), the r array should have three delta timestamps [...]]]></description>
			<content:encoded><![CDATA[<p>Look at this code.  What do you expect to be the outcome?</p>
<p><span id="more-104"></span></p>
<div class="syntax_hilite">
<div id="javascript-2">
<div class="javascript"><span style="color: #003366; font-weight: bold;">var</span> d = <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #003366; font-weight: bold;">var</span> r = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;<br />
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j=<span style="color: #CC0000;">0</span>,k=<span style="color: #CC0000;">2</span>;j&lt;k ;j++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; window.<span style="color: #006600;">setInterval</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> next = <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; r.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span>next.<span style="color: #006600;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> - d.<span style="color: #006600;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,<span style="color: #CC0000;">1000</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Every 1000 milliseconds (1 second), the <code>r array should have three delta timestamps added into it (one for each interval set in the for loop).  In FireFox, however, there are exactly nine delta timestamps added per second.  If you set <code>k=10</code>, the result is one hundred delta timestamps per second.  If anyone has the answer, I am curious, even if the result is that I'm an idiot.  It seems to work correctly in Internet Explorer 7.  Thanks for your help, internet.</k></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/12/23/problems-with-looping-through-windowsetinterval/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Forward Compatibility and JavaScript</title>
		<link>http://www.zachleat.com/web/2007/11/01/forward-compatibility-and-javascript/</link>
		<comments>http://www.zachleat.com/web/2007/11/01/forward-compatibility-and-javascript/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 01:53:20 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[Rendering Modes]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/11/01/forward-compatibility-and-javascript/</guid>
		<description><![CDATA[Many developers (myself included) complain endlessly about the problematic ECMAScript implementation that Internet Explorer uses called JScript.  And after reading one such very detailed complaint in the comments on Dave Massy's website at MSDN, and reading Chris Wilson's post about ECMAScript 3, it has become increasingly obvious of Microsoft's opinion on the subject of [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers (myself included) complain endlessly about the problematic ECMAScript implementation that Internet Explorer uses called JScript.  And after reading <a href="http://blogs.msdn.com/dmassy/archive/2006/11/30/vpc-to-run-ie6-and-ie7-on-the-same-machine.aspx">one such very detailed complaint</a> in the comments on Dave Massy's website at MSDN, and reading <a href="http://blogs.msdn.com/ie/archive/2007/10/30/ecmascript-3-and-beyond.aspx">Chris Wilson's post about ECMAScript 3</a>, it has become increasingly obvious of Microsoft's opinion on the subject of Forward Compatibility with JavaScript.  It's something they keep pounding their fists on the ground about, how they are adamant that new versions of their browser not "Break the Web."</p>
<p>Of course, "Breaking the Web" refers to the amount of code on the internet today that is an equal and opposite reaction to the broken bug-ridden JavaScript implementation of their browser.  It describes the unimaginable future in which Internet Explorer fixed the many well documented <em>intricacies</em> of JScript and thereby ruins the code that was originally written to support the problem.  What a conundrum.</p>
<p>But haven't we already been through this problem?  Isn't this the same exact thing we saw in the early days of CSS?  And how did the major browser players react?  By implementing both a <a href="http://www.quirksmode.org/css/quirksmode.html">Quirks and Standards mode for CSS through DocType switching</a>.  Now my question is:</p>
<p><strong>Why haven't we seen a Quirks and Standards Compatibility Mode for JavaScript?</strong></p>
<p>I'm not necessarily encouraging the Quirks and Standards modes to be toggled with the DocType (as with CSS), but why not have these two modes?  To enable your site to use the Standards mode of JavaScript, the browser might require a certain DocType to be declared, or it might require a different script type in the browser:</p>
<div class="syntax_hilite">
<div id="html-4">
<div class="html"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> mode=<span style="color: #ff0000;">"standards"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</div>
</div>
<p></p>
<p>Either that, or <a href="http://dean.edwards.name/weblog/2007/03/yet-another/">I could just use Base2</a>.</script></p>
<p>Technorati Tags: <a href="http://technorati.com/tag/JavaScript" rel="tag">JavaScript</a>, <a href="http://technorati.com/tag/ECMAScript" rel="tag"> ECMAScript</a>, <a href="http://technorati.com/tag/Quirks+Mode" rel="tag"> Quirks Mode</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/11/01/forward-compatibility-and-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cross Domain XHR with Firefox</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/</link>
		<comments>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 23:40:20 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/</guid>
		<description><![CDATA[By now know you know that trying to do an XMLHttpRequest (XHR or AJAX) call to a domain that is different from the domain of the hosted JavaScript in Firefox will throw an exception.
Error: uncaught exception: Permission denied to call method XMLHttpRequest.open
If you don't want a history of the past solutions, page down to see [...]]]></description>
			<content:encoded><![CDATA[<p>By now know you know that trying to do an XMLHttpRequest (XHR or AJAX) call to a domain that is different from the domain of the hosted JavaScript in Firefox will throw an exception.</p>
<p><code>Error: uncaught exception: Permission denied to call method XMLHttpRequest.open</code></p>
<p>If you don't want a history of the past solutions, page down to see the final solution.</p>
<p>The web has solutions to this problem, but most of them involve changing your JavaScript code, which I thought to be less than ideal.  A common solution involves setting the UniversalBrowserRead security property in your JavaScript code [<a href="http://almaer.com/blog/archives/000794.html">Dion Almaer</a>, of Ajaxian fame]:</p>
<div class="syntax_hilite">
<div id="javascript-7">
<div class="javascript">netscape.<span style="color: #006600;">security</span>.<span style="color: #006600;">PrivilegeManager</span>.<span style="color: #006600;">enablePrivilege</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'UniversalBrowserRead'</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>The problem with that solution (obviously) lies in single browser proprietary JavaScript polluting your code.  And you have to set this property inside the scope of any usage (ie: inside your library file that does your AJAX calls and inside your callbacks, etc).</p>
<p>Why can't it just be as easy as Internet Explorer?  They just pop-up a little security dialog asking you if you want to allow this access (which is also what the <code>enablePrivilege</code> function does as well).</p>
<p>Another solution involves setting the <code>capability.policy.default.XMLHttpRequest.open</code> preference inside your prefs.js Firefox preference file [<a href="http://blog.dirolf.com/2007/06/enabling-cross-domain-ajax-in-firefox.html">Mike Dirolf</a>].  This worked as desired and allowed the AJAX call, but anytime you attempt to access the resulting XML you received a nice exception as well.  It turns out this is the solution we wanted, it's just incomplete.</p>
<h2><a name="solution">The Final Solution</a></h2>
<ol>
<li>Close Firefox.  It will overwrite your changes to the prefs.js file if you have it open.</li>
<li><em>Optional step</em>: This approach will open up your Firefox security quite a bit, so I'd recommend setting up a separate profile in Firefox to use when testing.  It will <strong>not </strong>pop up a security dialog when a cross-domain AJAX call is made.</li>
<li>Find your prefs.js file.  In Windows, it is typically located in the <code>C:\Documents and Settings\{YOUR_USERNAME}\ApplicationData\Mozilla\Firefox\Profiles\{YOUR_TEST_USER_PROFILE_ID}\prefs.js</code></li>
<li>Open it up and add the following lines:
<div class="syntax_hilite">
<div id="javascript-8">
<div class="javascript">user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.open"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.CDATASection.nodeValue"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Element.attributes"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Element.childNodes"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Element.firstChild"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Element.getElementsByTagName"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Element.tagName"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.HTMLCollection.length"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.HTMLCollection.item"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.Text.nodeValue"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLDocument.documentElement"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLDocument.getElementsByTagName"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.channel"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.open"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.responseText"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.responseXML"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.send"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;<br />
user_pref<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"capability.policy.default.XMLHttpRequest.setRequestHeader"</span>, <span style="color: #3366CC;">"allAccess"</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p>
</li>
</ol>
<p>This code was copied (with the exception of 1 line) from a source repository at [<a href="http://svn.kryogenix.org/filedetails.php?repname=kryogenix.org&#038;path=%2Fjackfield%2Ftrunk%2Fhtmlui%2Fprefs.js&#038;rev=0&#038;sc=0">kryogenix.org</a>]<br />
used in jackfield.  It wasn't intended to be used for this purpose, but it works.</p>
<p>If you still get <code>Error: uncaught exception: Permission denied to call method _________</code> errors, you can add the method to your prefs.js.  I would appreciate a comment with any commonly used methods not included above.  Thanks.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Firefox" rel="tag">Firefox</a>, <a href="http://technorati.com/tag/Cross+Domain" rel="tag"> Cross Domain</a>, <a href="http://technorati.com/tag/AJAX" rel="tag"> AJAX</a>, <a href="http://technorati.com/tag/XHR" rel="tag"> XHR</a>, <a href="http://technorati.com/tag/JavaScript" rel="tag"> JavaScript</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Screen Readers and Listening at the Speed of Sound</title>
		<link>http://www.zachleat.com/web/2007/05/17/screen-readers-and-listening-at-the-speed-of-sound/</link>
		<comments>http://www.zachleat.com/web/2007/05/17/screen-readers-and-listening-at-the-speed-of-sound/#comments</comments>
		<pubDate>Fri, 18 May 2007 00:23:38 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[Application Design]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Accessibility]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/05/17/screen-readers-and-listening-at-the-speed-of-sound/</guid>
		<description><![CDATA[Here is a presentation given by a guy named Victor Tsaran on how he personally uses screen readers to browse the web.  As web developers, accessibility is an important aspect of our work and cannot be ignored.  How many websites have you browsed that had flash navigation?  If you're not a web [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a <a href="http://yuiblog.com/blog/2007/05/14/video-intro-to-screenreaders/">presentation</a> given by a guy named Victor Tsaran on how he personally uses screen readers to browse the web.  As web developers, accessibility is an important aspect of our work and cannot be ignored.  How many websites have you browsed that had flash navigation?  If you're not a web developer, you need to skip ahead to time stamp 25:44 to see the mega-fast speed this guy uses the screen reader at.  I couldn't understand a single word coming out of my speaker.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/05/17/screen-readers-and-listening-at-the-speed-of-sound/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I-Frame Shims or How I Learned to Stop Worrying and Love the Bomb</title>
		<link>http://www.zachleat.com/web/2007/04/24/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/</link>
		<comments>http://www.zachleat.com/web/2007/04/24/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 21:51:55 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/24/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/</guid>
		<description><![CDATA[So again, I show up late to the party.  IE7 is already out, but my target customers are still using IE6.  So today, boys and girls, we're going to discover the magical world of using I-Frame shims to hide those bleeding heart select boxes from showing through our layered elements.
Typically, when creating an [...]]]></description>
			<content:encoded><![CDATA[<p>So again, I show up late to the party.  IE7 is already out, but my target customers are still using IE6.  So today, boys and girls, we're going to discover the magical world of using I-Frame shims to hide those bleeding heart select boxes from showing through our layered elements.</p>
<p>Typically, when creating an I-Frame shim, you're going to create the i-frame dynamically using document.createElement.  Let's start out with some successful code.</p>
<div class="syntax_hilite">
<div id="javascript-10">
<div class="javascript"><span style="color: #003366; font-weight: bold;">var</span> iframeShim = document.<span style="color: #006600;">createElement</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'iframe'</span> <span style="color: #66cc66;">&#41;</span>;<br />
iframeShim.<span style="color: #006600;">setAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'src'</span>, <span style="color: #3366CC;">'javascript:false;document.write(”&quot;);'</span> <span style="color: #66cc66;">&#41;</span>;<br />
iframeShim.<span style="color: #006600;">setAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'frameBorder'</span>, <span style="color: #3366CC;">'0'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Now for some caveats you might have encountered with code not matching the above:</p>
<p><strong>I-Frame frameBorder attribute</strong><br />
Are you trying to get rid of that nasty i-frame border in Internet Explorer 6 (IE6)?  Tried CSS properties?  Tried setting the frameBorder attribute?  It turns out that when setting the frameBorder attribute, the name of the attribute is case sensitive.  Using frameborder will not work correctly, but using frameBorder (with a capital B) will give the desired result.  [Source: <a href="http://www.visible-form.com/blog/createelement-and-events-and-iframe-borders/">FlashApe</a>]</p>
<p><strong>HTTPS and I-Frame src attribute</strong><br />
Is your page hosted on a secure domain (https instead of just http)?  Is the dynamically created iframe causing the following error message in Internet Explorer?</p>
<p><em>This page contains both secure and nonsecure items.  Do you want to display the nonsecure items?</em></p>
<p>Some have suggested that changing the src attribute to point to a blank html page with no content is the solution, but that's an extra http request on your page that is unnecessary.  Others have suggested that that changing the src attribute to javascript:false works.  It does, in fact, but writes the text 'false' to your iframe content.  Others have suggested javascript:void(0) as your src attribute value [Source: <a href="http://ewbi.blogs.com/develops/2004/07/ie_iframe_and_h.html">ewbi.develops</a>], but some Internet Explorer clients still have secure and nonsecure items alert popup.  I have not figured out the factors that separate these Internet Explorer clients.  </p>
<p><strong>Update</strong>: The correct solution is in face setting "javascript:false;document.write(”");" as your src value, as I found in the <a href="http://malsup.com/jquery/block/">jQuery BlockUI</a> plugin.  This is a silver bullet fix that will avoid all the problems I have encountered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/04/24/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Code Coverage Tool for Firebug</title>
		<link>http://www.zachleat.com/web/2007/04/18/javascript-code-coverage-tool-for-firebug/</link>
		<comments>http://www.zachleat.com/web/2007/04/18/javascript-code-coverage-tool-for-firebug/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 20:08:06 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Web Browsers]]></category>

		<category><![CDATA[Code Coverage]]></category>

		<category><![CDATA[Firebug]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/18/javascript-code-coverage-tool-for-firebug/</guid>
		<description><![CDATA[Download FirebugCodeCoverage-0.1.xpi
Recently, I've become interested in client side automated testing tools.  When I found the Selenium plug-in for Firefox, I was blown away.  I can record actions in my browser and play them back!  No more manual testing of JavaScript code!
Researching a little bit more about automated testing tools led to the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zachleat.com/Projects/firebugCodeCoverage/FirebugCodeCoverage-0.1.xpi"><strong>Download FirebugCodeCoverage-0.1.xpi</strong></a></p>
<p>Recently, I've become interested in client side automated testing tools.  When I found the <a href="http://www.openqa.org/selenium-ide/">Selenium</a> plug-in for Firefox, I was blown away.  I can record actions in my browser and play them back!  No more manual testing of JavaScript code!</p>
<p>Researching a little bit more about automated testing tools led to the discovery of a metric called 'Code Coverage', a statistic that gives you a percentage of how much of your code executed during a certain period of time (usually while your automated test was executing).</p>
<p>Of course, I immediately thought of <a href="http://www.getfirebug.com/">Joe Hewitt's Firebug</a> extension for Firefox, which includes a feature for JavaScript Profiling.  The Profile feature of Firebug was similar to a Function Entry Code Coverage report, so I decided to modify the feature and release an add-on for Firefox that showed (at a file level) a list of which functions executed and which functions did not.</p>
<p><img src='http://www.zachleat.com/web/wp-content/uploads/2007/04/coverage.gif' alt='coverage.gif' /></p>
<p>So, now, to test my JavaScript code coverage, I will write automated tests using the Selenium IDE plug-in for Firefox, hit the Code Coverage button in Firebug, and try to get my Code Coverage statistics in the upper 90%'s.</p>
<p>Screenshot Example of running the tool at yahoo.com<br />
<img src='http://www.zachleat.com/web/wp-content/uploads/2007/04/coverage2.gif' alt='Code Coverage' /></p>
<p><a href="http://www.zachleat.com/Projects/firebugCodeCoverage/FirebugCodeCoverage-0.1.xpi"><strong>Download FirebugCodeCoverage-0.1.xpi</strong></a>.</p>
<p><strong>Requirements (obviously)</strong></p>
<ul>
<li>Mozilla Firefox</li>
<li>Firebug Extension for Mozilla Firefox</li>
</ul>
<p><strong>Limitations</strong>:</p>
<ul>
<li>Does not include statistics on anonymous functions.</li>
<li>Is limited to function (entry) code coverage, does not include other forms such as exit, statement, condition, or path code coverage. (Description: <a href="http://en.wikipedia.org/wiki/Code_coverage">Wikipedia</a>)</li>
<li>Is my first Firefox add-on, so there was a learning curve involved.</li>
</ul>
<p><strong>Future Improvements</strong>:</p>
<ul>
<li>Automated integration with Selenium IDE (one button to run tests and do code coverage)</li>
<li>Better display of results, instead of a big kludge of function names</li>
<li>Additional types of coverage, depending on what options are available from <a href="http://www.xulplanet.com/references/xpcomref/ifaces/jsdIDebuggerService.html">jsdIDebuggerService</a></li>
</ul>
<p>Technorati Tags: <a href="http://technorati.com/tag/Firebug" rel="tag">Firebug</a>, <a href="http://technorati.com/tag/Code+Coverage" rel="tag"> Code Coverage</a>, <a href="http://technorati.com/tag/JavaScript" rel="tag"> JavaScript</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/04/18/javascript-code-coverage-tool-for-firebug/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
