<?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>The Path to Zen &#187; web-design</title>
	<atom:link href="http://www.digizenstudio.com/blog/categories/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digizenstudio.com/blog</link>
	<description>Jing Xue's Weblog</description>
	<lastBuildDate>Tue, 01 Jun 2010 01:40:50 +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>A few thoughts on Yahoo&#8217;s free YUI hosting offer</title>
		<link>http://www.digizenstudio.com/blog/2007/02/28/a-few-thoughts-on-yahoos-free-yui-hosting-offer/</link>
		<comments>http://www.digizenstudio.com/blog/2007/02/28/a-few-thoughts-on-yahoos-free-yui-hosting-offer/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 15:20:31 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2007/02/28/a-few-thoughts-on-yahoos-free-yui-hosting-offer/</guid>
		<description><![CDATA[YUI has been my favorite AJAX library for two reasons: its unintrusiveness to the server side, and the excellent documentation. It is interesting and encouraging to see Yahoo offer free hosting for YUI. While there are obviously valid reasons for some sites not to use this service (external dependency etc.), the power of yahoo&#8217;s server [...]]]></description>
			<content:encoded><![CDATA[<p>YUI has been my favorite AJAX library for two reasons: its unintrusiveness to the server side, and the excellent documentation. It is interesting and encouraging to see <a href="http://yuiblog.com/blog/2007/02/22/free-yui-hosting/" rel="_blank">Yahoo offer free hosting for YUI</a>. While there are obviously valid reasons for some sites not to use this service (external dependency etc.), the power of yahoo&#8217;s server facility, the advanced cache control, and the on-the-fly file size reduction (up to 90% according to the announcement linked) are in no doubt going to be very appealing to many others.<span id="more-130"></span></p>
<p>This did get me thinking, though &#8211; and let me preemptively clarify that &#8220;Yahoo is evil&#8221; is definitely <strong>not</strong> what I&#8217;m about to get at. And I truly appreciate this offering as a noble intention and a community-friendly move, rather than any sleek public image stunt. Nevertheless, if we look at it in the whole bigger picture of &#8220;where F/OSS is going today&#8221;, this is yet another instance of a big corporation leveraging its muscle to support an F/OSS project. Regardless of Yahoo&#8217;s intention, in reality, there is still the feeling of a lesser leveling playground for those other projects without any backing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2007/02/28/a-few-thoughts-on-yahoos-free-yui-hosting-offer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Odd YUI Error</title>
		<link>http://www.digizenstudio.com/blog/2006/08/17/an-odd-yui-error/</link>
		<comments>http://www.digizenstudio.com/blog/2006/08/17/an-odd-yui-error/#comments</comments>
		<pubDate>Fri, 18 Aug 2006 02:36:39 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2006/08/17/an-odd-yui-error/</guid>
		<description><![CDATA[YUI Connection Manager throws this error when the ajax url passed to it is invalid (invalid as in, like, &#8220;I forgot to set the value!&#8221;). What makes it more obscure is it prints out the page url, which often looks alike, if not the same, the ajax url:
uncaught exception: [Exception... "Component returned failure code: 0x80070057 [...]]]></description>
			<content:encoded><![CDATA[<p>YUI Connection Manager throws this error when the ajax url passed to it is invalid (invalid as in, like, &#8220;I forgot to set the value!&#8221;). What makes it more obscure is it prints out the page url, which often looks alike, if not the same, the ajax url:</p>
<blockquote><p>uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]&#8221; nsresult: &#8220;0&#215;80070057 (NS_ERROR_ILLEGAL_VALUE)&#8221; location: &#8220;JS frame :: http://localhost:8080/myapp/foo.do :: anonymous :: line 0&#8243; data: no]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2006/08/17/an-odd-yui-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X-JSON header useful in AJAX dialog submission flow</title>
		<link>http://www.digizenstudio.com/blog/2006/07/11/x-json-header-useful-in-ajax-dialog-submission-flow/</link>
		<comments>http://www.digizenstudio.com/blog/2006/07/11/x-json-header-useful-in-ajax-dialog-submission-flow/#comments</comments>
		<pubDate>Wed, 12 Jul 2006 02:31:03 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/?p=98</guid>
		<description><![CDATA[One AJAX page I&#8217;ve been playing with has this UI flow that emulates a desktop form dialog &#8211; the user clicks on a link, a modal dialog shows up with a usual form, which the user fills out and submits to the server. Now, a successful response from the server can be one of these: [...]]]></description>
			<content:encoded><![CDATA[<p>One AJAX page I&#8217;ve been playing with has this UI flow that emulates a desktop form dialog &#8211; the user clicks on a link, a modal dialog shows up with a usual form, which the user fills out and submits to the server. Now, a successful response from the server can be one of these: if there are any form validation errors, the response is the same form annotated with the error message(s), in this case the response should be used to refresh the dialog. If there are no errors, the dialog is closed, and the response from the server should contain some content to update the area above the original link the user clicked on.<span id="more-98"></span></p>
<p>The tricky part &#8211; at least trickier than I thought &#8211; in implementing this whole thing turned out to be how to establish a consistent and non-hacking way to distinguish between a response with form validation errors and one without. Even though most AJAX toolkits today provide nice wrappers around raw HttpXMLRequest calls, and will invoke appropriate callback in the case of success or failure, they can&#8217;t help in this case, because whether there are validation errors or not the response would always appear successful to the wrappers. So I&#8217;m pretty much on my own to figure out a way to tell.</p>
<p>The simplest and most obvious way is to search for some magic word, e.g., some particular id in the response text that only appears in one of the responses. But somehow that sounds a bit hacking to me. And it&#8217;s not a very generic theme. I wouldn&#8217;t want to hand pick some magic word for each scenario like this.</p>
<p>Next I ruled out wrapping entire responses in JSON on the ground of scary escaping pitfalls.</p>
<p>So how about wrapping the responses in an XML element called, say, AjaxResponse? Then on client, I can parse this into an XML DOM element, take a look at its &#8217;status&#8217; attribute, and if it&#8217;s success, close the dialog, and update the div with whatever is wrapped? That actually worked &#8211; but only in Firefox, not in IE. IE appears to have some problem inserting a node into the current DOM, if the node was not created in the current window itself. In other words, the seemingly legitimate XHTML &#8216;div&#8217; element wrapped in AjaxResponse cannot be inserted into the current DOM tree using <code>someElement.appendChild(myDiv)</code>. It would return some mysterious &#8220;No such interface supported&#8221; error message. Even specifically adding <code>xmlns:xhtml="http://www.w3.org/1999/xhtml"</code> to the &#8216;div&#8217; element wouldn&#8217;t make IE know any better.</p>
<p>At last, I came to the solution the prototype javascript library uses in its connection manager package &#8211; an X-JSON reaponse header. It works like an out-of-band channel between the server and client. A piece of JSON data is set into the header by the server code (in either the form controller or the jsp page), and evaluated in the client javascript. Due to the limitation on how many characters can be sent in any http header, it&#8217;s not ideal for sending along large amount of data, but perfect for all other cases, such as mine. All I have to do is putting a status variable in there. The client would evaluate the JSON and decide accordingly whether to close the form and use the response body to populate a div in the main page, or to keep the form open and use the response body to show the form again. Even though I use Yahoo UI Library instead of prototype to handle ajax calls, this is very easy to implement, and generic to be reused in all the form handling scenarios. The best part is, of course, that it&#8217;s separated from the response body, which can remain simply whatever content xhtml the client can use to fill out a div area. Another bonus from this approach is that, since all the data particular to the AJAX call are separated into the X-JSON header, the same jsp form page is AJAX-agnostic, and can be reused in other non-Ajax pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2006/07/11/x-json-header-useful-in-ajax-dialog-submission-flow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sitemesh+YUI+IE=2 lessons learned</title>
		<link>http://www.digizenstudio.com/blog/2006/06/04/sitemeshyuiie2-lessons-learned/</link>
		<comments>http://www.digizenstudio.com/blog/2006/06/04/sitemeshyuiie2-lessons-learned/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 01:03:20 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/?p=97</guid>
		<description><![CDATA[I&#8217;ve been using the Panel component in YUI(Yahoo UI Library) to build an AJAX page, which as part of the whole web application is wrapped by the standard boilerplate via sitemesh. It worked out all well and fairly straightforward &#8211; well, at least in Firefox and Opera, but in the dreaded, we-render-pages-with-lots-of-imagination IE 6, the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the Panel component in YUI(Yahoo UI Library) to build an AJAX page, which as part of the whole web application is wrapped by the standard boilerplate via sitemesh. It worked out all well and fairly straightforward &#8211; well, at least in Firefox and Opera, but in the dreaded, we-render-pages-with-lots-of-imagination IE 6, the panel showed up with a totally messed up layout, and worse, under the modal mode the entire page, <em>including</em> the panel itself, was masked with a 0.5 opaque layer and refused to take any input.<span id="more-97"></span></p>
<p>The messed up layout was easy to fix &#8211; I accidentally set omit-xml-declaration to true for that jspx page, so the page rendered starts with the xml declaration line before the xhtml doctype, which, of course, kicked IE into the quirks mode.  (It kind of makes some hell of sense, though. After all, a page starting with xml declaration <em>cannot</em> possibly be an XML document, can it?)</p>
<p>Now, the tricky part. The YUI example page worked fine in IE, so that made me feel better because for a moment there I was panicking thinking how I wasted all the time building the page with some wrong tool. After some reducing, diffing, and turning every stone over, well, it turned out that, according to the YUI Panel document, for panels that are not dynamically created by javascript, we only need to call panel.render() without passing a parent node, but that actually only works when the panel is a direct child of document.body, which happens not to be the case in my page &#8211; once sitemesh has applied the page template, what used to be the body becomes wrapped in a div. The fix itself is quite simple though. Instead of calling render(), always call render(document.body).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2006/06/04/sitemeshyuiie2-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Add padding to images in IE</title>
		<link>http://www.digizenstudio.com/blog/2006/04/20/add-padding-to-images-in-ie/</link>
		<comments>http://www.digizenstudio.com/blog/2006/04/20/add-padding-to-images-in-ie/#comments</comments>
		<pubDate>Fri, 21 Apr 2006 02:43:13 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2006/04/20/add-padding-to-images-in-ie/</guid>
		<description><![CDATA[An IE quirks mode issue I ran into:
Evidently, this,
PLAIN TEXT
CSS:




img &#123; display: block; border: 1px solid #999999; padding: 15px; &#125; 






will not put a 15px wide "moat" between an image and its border in IE 6 (works well in Firefox).  The workaround is to add a 'div' around the image, and set the above [...]]]></description>
			<content:encoded><![CDATA[<p>An IE quirks mode issue I ran into:<span id="more-91"></span></p>
<p>Evidently, this,</p>
<div class="igBar"><span id="lcss-2"><a href="#" onclick="javascript:showPlainTxt('css-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-2">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">img <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">block</span>; <span style="color: #000000; font-weight: bold;">border</span>: 1px <span style="color: #993333;">solid</span> #999999; <span style="color: #000000; font-weight: bold;">padding</span>: 15px; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
will not put a 15px wide "moat" between an image and its border in IE 6 (works well in Firefox).  The workaround is to add a 'div' around the image, and set the above properties to the div.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2006/04/20/add-padding-to-images-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Reason for &#8220;No XHTML 1.1 STRICT&#8221;</title>
		<link>http://www.digizenstudio.com/blog/2006/01/25/another-reason-for-no-xhtml-11-strict/</link>
		<comments>http://www.digizenstudio.com/blog/2006/01/25/another-reason-for-no-xhtml-11-strict/#comments</comments>
		<pubDate>Thu, 26 Jan 2006 04:43:55 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/?p=82</guid>
		<description><![CDATA[For me, other than the browser supporting issues cited by Brennan, one major and (I think) fairly practical obstable to adopting XML Strict is the difficulty to pop up a new browser window, simply because the 'target' attribute is being phased out.  Of course, we can work around it with some Javascript stunt, just [...]]]></description>
			<content:encoded><![CDATA[<p>For me, other than the browser supporting issues cited by <a href="http://brennan.offwhite.net/blog/archives/000306.html" rel="_blank">Brennan</a>, one major and (I think) fairly practical obstable to adopting XML Strict is the difficulty to pop up a new browser window, simply because the 'target' attribute is being phased out.  Of course, we can work around it with some <a href="http://www.sitepoint.com/article/standards-compliant-world/3" rel="_blank">Javascript stunt</a>, just like what I've been doing with this blog site (I was in this "I've got to be strictly compliant" mode when I was putting together this site), but it just feels a bit silly after all the hoops, doesn't it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2006/01/25/another-reason-for-no-xhtml-11-strict/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>meebo: an AJAX IM</title>
		<link>http://www.digizenstudio.com/blog/2005/09/15/meebo-an-ajax-im/</link>
		<comments>http://www.digizenstudio.com/blog/2005/09/15/meebo-an-ajax-im/#comments</comments>
		<pubDate>Fri, 16 Sep 2005 03:29:31 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[fisheye]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2005/09/15/meebo-an-ajax-im/</guid>
		<description><![CDATA[meebo is an AJAX-based instant messenger a few guys just launched. It's still in "alpha", but the idea is cool (some idea can be not really new, but still cool, ok?   .)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.meebo.com" rel="_blank">meebo</a> is an AJAX-based instant messenger a few guys just launched. It's still in "alpha", but the idea is cool (some idea can be not really new, but still cool, ok? <img src='http://www.digizenstudio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2005/09/15/meebo-an-ajax-im/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

