tag:blogger.com,1999:blog-58603415931290725372024-03-12T23:50:57.739-04:00Building the WebExploring the technical, sociological and economical foundry blocks of the World Wide Web.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-5860341593129072537.post-37913743607409414732008-04-26T19:13:00.002-04:002008-04-26T19:20:54.916-04:00Moving this blogThis is my last post using Blogger. I have moved my blog to TypePad to give it new life and a new focus.<br /><br /><a href="http://buildingtheweb.typepad.com">GO TO MY NEW BLOG</a>Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0tag:blogger.com,1999:blog-5860341593129072537.post-34001463001849827992008-04-25T12:04:00.003-04:002008-04-25T12:31:25.891-04:00New FocusWhen I started this blog, I gave it the subtitle of "Exploring the technical, sociological and economical foundry blocks of the World Wide Web.". I found that most of my post hovered around the technological concepts of RIA and the web as a platform. Probably because I was working mostly as a software engineer at the time. As I have been shifting more to the user experience, interaction design and product management, the more I became dissatisfied in the details of the technology. I have not only the sociological issues more compelling, but the psychological and particularly cognitive issues of web as a platform more and more important to where the web is going, and what is in it's future.<br /><br />So, I am shifting this blog to "Exploring the psychological, economical and technical structure of the Internet." I am preparing a flurry of blogs, and plan to start posting much more readily in the very near future. I may end up moving this blog, and if so, my next post may be my last on blogger.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0tag:blogger.com,1999:blog-5860341593129072537.post-82464338625466753782008-04-01T23:33:00.006-04:002008-04-02T00:37:08.270-04:00Why CSS's CLIP is your friendWhen you get to the point on a project where page load-time becomes a concern, there is a usual play book that most of us pull out.<br /><br /><ol type="1"><br /><li>Glob your CSS and JavaScript into as few files as possible.</li><br /><li><a href="http://dean.edwards.name/packer/">Pack</a> or <a href="http://www.julienlecomte.net/blog/2007/08/13/">minify</a> your JavaScript.</li><br /><li>Trim whitespace in your CSS.</li><br /><li>Start pre-loading images for roll-over effects.</li><br /></ol><br /><br />Maybe you go so far as to <a href="http://ajaxpatterns.org/wiki/index.php?title=On-Demand_Javascript">lazy-load content via JavaScript</a>. However, I will still do you one better...<br /><br />Glob your static images onto one image map. Place all of your icons, or all of your tabs and their rollover counterparts into one larger image. Then, in the css of each image element, add a <a href="http://www.w3schools.com/CSS/pr_pos_clip.asp">Clip</a> definition to the CSS or style attribute.<br /><br /><b>What are the benefits?</b><br /><br />In this case, the whole is less than the parts. This means smaller file size, but more importantly, it means far less packets. Each file is at least three packets on the wire. So, with lots of small files, such as a dozen or so icons, you can reduce the number of packets on the line by as much as two-thirds.<br /><br />The second nicety of using clip is that mouse-overs are really smooth when you just shift the clip's rect rather than swapping out images.<br /><br />There is another cool side-effect. If your site is slow loading for any reason, (i.e. client's machine is bogged) images will load in neat batches, rather than trickling in. This tends to actually make your site seem like it is less broken. Many users are more often annoyed by that one image that has not loaded, than when the whole lot is still loading. It is just distracting. Pay attention next time, I bet you will agree.<br /><br /><b>What are the pitfalls?</b><br /><br />There are only two. First, clip: rect(); can be a pain to specify. You almost never get the math right the first time. (x,y,w,h) would have been a far better specification. Second, you need to pay close attention to what images you group together. Do not group together an image that should be jpeg with an image that should be a gif, and when grouping gifs, pay very close attention to the color pallet and make sure you are grouping like-images and not sacrificing too much picture quality.<br /><br />That said, this trick is one that really should make into a lot of developers performance play books.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0tag:blogger.com,1999:blog-5860341593129072537.post-6516478699919937742008-03-19T23:32:00.005-04:002008-03-20T08:47:04.212-04:00Opening up to OpenSocial, OpenID, hCard and oAuthSo, there is a flood of propaganda coming out of the web 2.0 conferences either about OpenSocial, OpenID, oAuth or hCard. And many people seem to be smoking the peace pipe and passing it along. Sorry, but I don't smoke, and I don't read the tabloids. Usually, I like to wait until a technology is <a href="http://www.amazon.com/s/ref=nb_ss_gw/105-7048557-8586808?url=search-alias%3Daps&field-keywords=OpenSocial+OpenID+oAuth+hCard&x=0&y=0"> bound and in print</a>, before I am ready to commit. Sorry, but it is an old guy's habit after seeing too many idealogical fads hit the Internet.<br /><br /><span style="font-style:italic;">However</span>, <a href="http://rura.org/blog/">a co-worker</a> said something today that actually made sense to me. And it was not about only having one login to remember, or how cool it was to link all your accounts together, or any other feature set that has been tried before. It was the way he related the registration process to a check out process, and indirectly related the registration information to credit card information.<br /><br />...Okay, so you probably do not get why this excited me enough to write a blog about it, but read on...<br /><br />For the last few weeks I have been doing a lot of reading on usability, design, and marketing. And the only thing that I think every time someone mentions these technologies is "So great. You want me to both convince users to register with my site, and do so using a process they are unfamiliar with?" What if my user does not have a GMail or Blogger account? How are you not setting me up to just confuse a lot of people? I mean, how do you expect to sell this to non-geeks? The n00bs? My mom? (Yes, my mom is my favorite test-case for usability. If she gets it, everyone does.)<br /><br />So, the concept of these services as personal information brokers in the same way that Visa and Mastercard are brokers of my credit card information is powerful. If registration is a checkout, your login is your credit card information, and sign-in is like Amazon's 1-click purchase. This ability to relate these systems to a very well established user interaction might just give this whole thing some credit. I can now see a small sliver of light that suggests this stuff might make it to hard copy, might be around in three years, and might be worth my time considering.<br /><br />To the many behind OpenSocial, OpenID, hCard, oAuth, and whatever else is out there, my suggestion is this: Stop selling this stuff to me, the web 2.0 geek, and start figuring out how you are going to sell it to my mom. You do that, and you will have a recipe for success. So, please go fire up your branding iron and get to work, because you have <a href="http://www.amazon.com/Crossing-Chasm-Geoffrey-Moore/dp/0060517123/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1205986682&sr=1-1"> long chasm to cross</a> if you really want this to catch on.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0tag:blogger.com,1999:blog-5860341593129072537.post-64989162769549843642008-03-08T10:09:00.005-05:002008-03-08T11:29:49.453-05:00GUIDs, UUIDs, and Canonical Names in JavaScriptCreating unique identifiers outside of a database tends to be a bit of a pain. So, why would you do it? What if you were not using a database? What if you have distributed servers? What if you want clients to be able create distinguishable content without constantly contacting the server? For example, if clients are aggressively creating parallel content, then it would be advantageous for you to be able to lazily sync the content without causing significant lag and interruption to the user. I realize that most of you will not run into this, but for those of you who do, here are some helpful notes:<br /><br />Firstly, I can't tell you how many postings I found that led to tutorials using an ActiveX object to create a UUID. If you have only IE-using clients that do not have stringent security settings, then I guess you can use this. Otherwise, it is no good.<br /><br />I soon found <a href="http://www.af-design.com/services/javascript/uuid/">This UUID library from AF-Design</a>, which is alright, but there are obvious inefficiencies, such as the way it computes time in milliseconds out the long way instead of just using Date.getTime(). Also, a serious design flaw is that it doesn't use any unique data other than time in milliseconds to generate the UUID. To be a true UUID, it would need to utilize unique data to the machine such as IP, or even better the MAC address. Otherwise two machines could potentially generate the same UUID.<br /><br />Understandably, there is no method for fetching the mac or ip address using only JavaScript within a browser. But, you can make the client's IP available to the JavaScript running on the client browser by echo-ing back the REMOTE_ADDR from a request header back to the client. For an example of how to do this in PHP, see <a href="http://unix.cms.gre.ac.uk/code/php/examples/remote_addr.php">http://unix.cms.gre.ac.uk/code/php/examples/remote_addr.php</a>.<br /><br />Since I usually do not care to have my unique id's in the traditional UUID format, I tend to go with a canonical name using an <a href="http://www.webtoolkit.info/javascript-md5.html">MD5</a> hash of the time and IP. The result is more reliable than the UUID example above, and is actually a bit faster and easy to implement:<br /><br /><pre><code><br />function cn() {<br /> var t = (new Date()).getTime();<br /> var ip = '192.168.1.100';<br /> return MD5(t+ip);<br />}<br /></code></pre><br /><br />I hope this helps any of you dealing with a similar design problem.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0tag:blogger.com,1999:blog-5860341593129072537.post-36489297715276289022008-01-28T23:38:00.000-05:002008-01-29T00:35:36.316-05:00Zero-width whitespace and what it can do for you...One of the most common layout problems I see in the web 2.0 space is accounting for the odd shaped content some people post. Long URLs are among the most common nuisance. Take for example:<br /><br />http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=G12&q=zwsp+zero-width+space&btnG=Search<br /><br />A long URL like this often overflows its container and is a layout nightmare. Most people's response is to simply set an overflow value, and either hide the remainder, or have a horizontal scrollbar. Neither of these solutions are ideal. Either way you are obscuring content, and I think everyone agrees that, in a web layout, horizontal scrollbars are the devil.<br /><br />The solution to this problem is Unicode character U+200C. (a.k.a. &#8203; or &zwsp;) This character achieves the exact opposite of the common non-breaking space (&nbsp;). Zero-width space does not render a visible space to the screen, but acts like a space for breaking up text when wrapping. Here is a javascript example of how to use it:<br /><br /><pre><code><br />function linkify(text) {<br /> var pre = text.substr(0,text.indexOf("http://"));<br /> var rest = text.substr(text.indexOf("http://"));<br /> var url = rest.split(/\s/,2)[0];<br /> rest = rest.split(/\s/,2)[1];<br /> var link = '<a href="'+url+'">';<br /> link += url.replace(/(\/|\+|=|\-)/g,"$1&#8203;");<br /> return pre+link+'</a>'+((rest)?rest:'');<br />}<br /></code></pre><br /><br />For the URL above, this would render the following html:<br /><br /><a href="http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=G12&q=zwsp+zero-width+space&btnG=Search">http:/​/​www.google.com/​search?hl=​en&client=​firefox-​a&rls=​org.mozilla%3Aen-​US%3Aofficial&hs=​G12&q=​zwsp+​zero-​width+​space&btnG=​Search</a><br /><br />Now this link nicely wraps to fit inside its container, and one of your worst layout nightmares is easily solved. I don't think it takes much creativity to figure out the other potential applications for this character.<br /><br />I cannot tell you what a pain it was to make sure every &, <, and > symbol in this post was properly escaped, so I hope you found this helpful.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com1tag:blogger.com,1999:blog-5860341593129072537.post-46501811693501496892007-12-09T15:17:00.000-05:002007-12-10T10:48:17.082-05:00It is time to take the WWW behind the shed and put it out of its misery.Almost everything that makes up the WWW is a hack. HTML, HTTP, SMTP, are all antiquated technologies. These old technologies were engineered with the sole intention of delivering and sharing text documents. Early web browsers and e-mail clients shared this same basic vision in the beginning. Even today, most media requires plug-ins and other technologies in order to be shared over the web. Where is the problem? It lies in the expectation in the end-users of the Internet. Over the last several years, the major players on the Internet are not delivering documents, but services and applications, which infer an expectation of user experience.<br /><br />The expectation of a controlled user experience is not a reasonable expectation of the Internet. The Internet by definition does not have any of the building blocks for a true user interface. Cookies are a terrible way to manage state, and HTTP+HTML has no traditional support for static or persistent elements. To go further, the standing trend over the last several years has been to deliver web-based applications. The complexity of these applications has been growing over the years to include two-way communication, streaming data, persistent state, and all of the other elements that traditional computer applications contain. All trying to be consistent across dozens of different browser/OS combinations with different connection rates and privacy and security restrictions.<br /><br /><span style="font-weight: bold;">HTML Limitations</span><br /><ul><li>Inconsistent across different platforms</li><li>Not intended to be used as a UI framework</li><li>Poor state control</li><li>No built-in multimedia control</li></ul><span style="font-weight: bold;">HTTP Limitations</span><br /><ul><li>2 connection limit per DNS host name</li><li>Does not support Keep-Alive</li></ul>The worst part of this combination is that the services that rely upon these technologies to deliver their service have little or no control upon how the two interact, because their service is a slave to whichever web browser the client uses to access them.<br /><br /><span style="font-weight: bold;">Standing Hacks</span><br /><ul><li>Frames</li><li>DHTML and DOM<br /></li><li>Plug-ins and ActiveX objects</li><li>Java Applets</li><li>XMLHttpRequest object</li></ul><span style="font-weight: bold;">Java Swing</span><br /><br />Java's Swing framework was probably the first reasonable attempt of a resolution. Its failures and shortcomings were few. Java is too heavy of a language for a UI framework. It isn't powerful enough to be fast and efficient. Java Runtime Environment has too much access to the client's machine, and not enough security for most people. On top of this, Swing's anti-aliasing and 2D drawing is less than attractive.<br /><br /><span style="font-weight: bold;">XULRunner<br /></span><br />From those wonderful guys at Mozilla, XULRunner utilizes XML and JavaScript and runs within the Gecko Runtime Environment. It is still young, but shows great promise.<br /><br /><span style="font-weight: bold;">Adobe AIR</span><br /><br />Adobe's Integrated Runtime, which was previously named Apollo, shows great promise. Not only does it utilize Flash and Flex, but also JavaScript and HTML. There are quite a few Open Source Flash initiatives such as MSASC and SwfMill for compiling ActionScript and XML into SWF files. Also, ActionScript has matured nicely over the years. If Adobe open-sourced an ActionScript compiler, this may just be the winning platform for the best way to build and distribute your applications.<br /><br />While HTTP and HTML will most likely remain the foundation blocks of the Internet, I have great faith that many of the services out there with web-delivered applications will be looking towards other technologies such as AIR or XULRunner in order to better control the user experience and deliver richer applications.<br /><br /><span style="font-weight: bold;">Update:<br /></span>This blog post criticizes web browsers failure to utilize multi-threading in multi-core systems. It is a valuable point and felt it worth adding here. <span style="font-weight: bold;"></span>http://pinderkent.blogsavy.com/archives/147<br /><span style="font-weight: bold;"></span>Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-11460320206421331352007-09-17T08:22:00.000-04:002007-09-17T09:24:42.311-04:00But, What Are We Really Building?On every major web project that I have ever worked on, there comes that point where I find myself asking 'But, what am I really building?'. Often, the project has some idealistic mission statement about 'Providing people with X and interested in Y a way to connect with Z.' Often, Y=Z or X=Y and the mission statement is all the simpler. However, once the product is actually unleashed on the real world, only 1/10<span class="blsp-spelling-error" id="SPELLING_ERROR_0">th</span> of the people have X or interested in Y or even care about connecting with Z. The other 90% are interested in people with X or who are interested in Y, and want to connect them with P.<br /><br /><span style="font-weight: bold;">Reverse Your Mission Statement</span><br /><br />What triggered me to write this blog entry was the comical, yet sadly true <a href="http://cracked.com/">Cracked.com</a> article<br /><a href="http://www.cracked.com/modules.php?op=modload&name=News&file=article&sid=1720"><strong><span class="print-title">Internet Safety Tips</span></strong></a>. So, my point is this: While mission statements define the market and give support to the projects scope, your product will be ten times as successful if you also approach the mission statement in reverse. How do I allow only Z to connect with people with X who are most likely to be interested in Y. This is particularly in products that contain any part 'social networking' in their mixture of features.<br /><br /><span style="font-weight: bold;">Case in Point</span><br /><br /><a href="http://myspace.com/"><span class="blsp-spelling-error" id="SPELLING_ERROR_1">Myspace</span>.com</a> has started to loose substantial ground for the first time in many months according to <a href="http://google.com/trends?q=myspace">Google Trends for <span class="blsp-spelling-error" id="SPELLING_ERROR_2">Myspace</span></a>. Shortly after 29,000 registered sex offenders were found on <span class="blsp-spelling-error" id="SPELLING_ERROR_3">Myspace</span>, there has been a noticeable decline in activity and new membership. While some good PR and new features should be able to turn this trend around, you have to ask in hindsight, what could have been done differently to avoid this?<br /><br />So, to all of you who are out there building your next great web product, please, please, please take the time to say, how do I keep people with X interested in Y from being targets of people attempting to connect them with P. Otherwise, do not be surprised when your product is shanghaied by the porn industry, illegal gambling, or other predators who can probably turn out a higher profit from your users than you can with their lack of moral fiber.<br /><br /><a href="http://www.cracked.com/modules.php?op=modload&name=News&file=article&sid=1720"><strong><span class="print-title"></span></strong></a>Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-4892600039973887182007-08-29T10:27:00.000-04:002007-08-29T11:11:02.532-04:0010 Years...About a week ago, I got another year older. As is typical, you find yourself reflecting from time to time about the past year. Though, while driving home one evening, I instead had a flashback to 10 years ago....<br /><br /><span style="font-weight: bold;">10 Years Ago</span><br /><br />I drove an '89 Plymouth Acclaim. It had a cassette player, cloth seats, and windows that you had to roll down. I had a cd player with a tape adapter, but it never worked right with the car radio. My cellular phone had a 10-digit lcd screen and could easily fit in my briefcase and I can even connect to my ISP at about 14.4k using it. My laptop was a Compaq Pentium 100MHz with 16MB RAM and a 4X CD-ROM drive that ran Windows 95. In those days, I was building websites using HTML 4.0, VBScript, JavaScript, Perl/CGI, Server-Side Includes, and was just learning about Allaire's ColdFusion and HomeSite.<br /><br /><span style="font-weight: bold;">Today</span><br /><br />I drive a '99 Jeep Grand Cherokee with powered leather seats and windows. It has an SCD player that can also play MP3's, WAV and WMA files off a CD-RW, and has an animated interactive LCD screen that shows me song titles and also heads my CD Changer, and my XM Satellite receiver. <br /><br />... That's right, I said "satellite"! OK, that really is not impressive, but if I said that 10 years ago, you would not have believed me...<br /><br />My cellphone today has TWO COLOR lcd screens, and I can use it to connect to the internet as fast as 1.4Mbps. My laptop now is an IBM Thinkpad 2GHz with 2GB RAM and 16x DVD-ROM/CD-RW running Windows XP SP2 and Ubuntu. And, I could not even begin to list all the tools I use these days without forgetting something.<br /><br /><br /><span style="font-weight: bold;">Ten Years From Now</span><br /><br />I guess I will be driving an '09 American Something that has power doors, remote climate control, GPS, complete media center that plays DVD's and can stream other media from my home server.<br /><br />My cell phone will be more of a portable access device that also streams multimedia, surfs the web, has a 20Mbps connection in some places and can interact seamlessly with my computers and car.<br /><br />My laptop will most likely have some cool bi-fold or tri-fold screen, a 1THz processor, 40GB Ram, HD-DVD-RW that multi-boots in several OS's.<br /><br />And, who knows why I will need it?Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-32385907007214975222007-08-02T14:12:00.001-04:002008-03-21T13:22:10.577-04:00AIR: Adobe Integrated Runtime<a href="http://labs.adobe.com/technologies/air/">AIR: Adobe Integrated Runtime</a><br /><br />Some products have already <a href="http://www.pownce.com">pownce</a>d on this still-beta framework. And, I think with good reason. AIR can utilize any mix of HTML / JavaScript / Ajax / Flash / Flex development resources in order to deliver cross-OS desktop applications.<br /><br />AIR has similarities to <a href="http://developer.mozilla.org/en/docs/XULRunner">XULRunner</a>. AIR is a runtime, like Java J2RE that needs to be installed onto the client's machine. The difference here is that while Mozilla and Sun may be household names to any geek with a computer, they still don't have quite the same name recognition that Adobe has with "normal" users due to their products (Flash and Acrobat). So the potential adoption curve of AIR is far greater.<br /><br />AIR is beautiful. Flash content means superior anti-aliasing, and makes it far easier to animate your application. Even the installer is pretty.<br /><br />If AIR gets even a quarter of the traction that Flash or Adobe gets, AIR is going to be very attractive, very fast. At that point, I see a lot of incentive for fat-client web applications to port their application if for no other reason than to eliminate the many, many pains of cross-browser support.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-11657071249876674732007-07-31T08:59:00.000-04:002007-08-09T00:42:03.835-04:00Good UI's are engineered.I have crossed the designer-engineer border many times, and I have come to the conclusion that many people have the wrong mindset about "UI Design". Many relate the "design" closer to designer jeans, than they do to say designing a bridge. While it is the decoration that makes the finished product appealing, it is the structure that is most important.<br /><br />This is how most UI Design processes go:<br /><ol><li>List out desired features</li><li>Sketch a few ideas</li><li>Mock until everyone agrees on something<span class="on" style="display: block;" id="formatbar_SpellCheck" title="Check Spelling" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);BLOG_spellcheck();;ButtonMouseDown(this);"></span> </li></ol>The bitter truth is:<br /><ol><li>Features change</li><li>Usually your first instincts are wrong</li><li><a href="http://en.wikipedia.org/wiki/Design_by_committee">Design by committee</a> will give you a camel</li></ol><br />UI Design is really no different than Network Design, Architectural Design, or any other form of structural design. You need to approach it with a set of given base parameters and develop a metric to measure all proposals against. A more proper procedure would be as follows:<br /><ol><li>Define the primary needs that the product provides</li><li>Script out the most common use cases</li><li>Draw flow charts to illustrate user paths</li><li>Define set of controls and display elements</li><li>Group related/parallel actions accordingly</li><li>Sketch out various options of all necessary screens</li><li>Measure if controls are present when wanted<br /></li><li>Measure distance to action and number of clicks to complete action</li></ol>Once screens, grouping and positioning is defined, it is now the time for decorations that will make actions intuitive and draw the right attention to the right items for each screen and to invoke the appropriate emotional responses from users. But, doing this earlier in the process often blinds you to other layout possibilities.<br /><br />Now when you look at this second process, it may seem longer and more daunting. However, the truth is that when you skip over the initial scripting and mapping process, you loose the metrics by which you may measure the successfulness of all future design proposals. When you follow the complete design process, you actually can spend less time in mocking process, and have a more measurable certainty of success in the end.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-36975633672610526172007-07-25T13:30:00.000-04:002007-07-25T14:04:27.301-04:00Client MVCA solid framework can make or break an evolving application. All to often, a simple application will grow too big for its britches and you are left with an organic mess. Lately, I am witnessing this the most with the re-emergence of fat-clients utilizing Ajax or similar technologies.<br /><br />There is little in the way for JavaScript framework out there, with Google's Web Toolkit being one of the few that is widely used. JQuery/Interface + DOJO or SAJAX could also bring back some sanity to your project, but the lines between Model, View and Controller are still blurry and unmanaged.<br /><br />I have found a couple good blogs that start to touch upon this problem, but no great projects that deal with the problem on a whole.<br /><br /><a href="http://blog.davidadamcoffey.com/4/triad-a-javascript-mvc-framework">triad: a javascript mvc framework</a><br /><br /><a href="http://brianmriley.com/blog/?p=33">Do RIAs Make You Rethink MVC?</a><br /><br />And even beyond the all so common Ajax-backed fat clients, there are still other technologies in the client scripting world that need an MVC framework to work with. JSON, Flash, XAML, and XULE are just a few that come to mind.<br /><br />Perl has Catalyst. Java has Struts. PHP has Mojavi. Python has Rails. But, JavaScript still lacks a flexible, multipurpose MVC framework that fits nearly any project. It seems the ideal candidate would be able to utilize existing toolkits interchangeably.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-70004809135339388532007-07-23T15:24:00.000-04:002007-07-23T16:38:09.449-04:00Avoiding 'Slow Script' ErrorsSo, you need to render 2,968 widgets to the DOM? Or, you really, really rather compute your data on the client, because the architectural geniuses you work with never thought you would want to cross-relate these two data sets, and it will be a load of work to re-architecture the back-end to handle this task? Well generally, my advice would be to avoid doing such tasks on the client, but that is not because it is not possible.<br /><br />Sometimes when prototyping algorithms or cross-linked data presentations, I find myself pushing the computational barrier of JavaScript. Anyone who has done this, has managed to repeatedly trigger the 'Slow Script' warning asking the user to either stop or continue. These messages are easy to avoid with a little code modification.<br /><br /><pre><code><br />function RenderDataSet(start) {<br /> var SEGMENT_SIZE = 100;<br /> var index = 0 + start;<br /> do {<br /> RenderData(index);<br /> index++;<br /> }<br /> while (index < dataset.length<br /> && index < start+SEGMENT_SIZE);<br /><br /> if (index<DataSet.length)<br /> setTimeout("RenderDataSet("+index+");",1);<br />}<br /></code></pre><br />Since you are only allowed a few seconds of the thread's time to carry out your task, and there is no forking or spawning available for you to make new threads, you simply have to rely on setTimeout(expr,time). This releases the thread for a very small fraction of a second to allow other browser actions to occur. This is also a good practice to get into for real-time applications as well, since expensive tasks can slow down other features of your web application.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-35650943580057285402007-07-19T16:34:00.001-04:002007-07-20T00:11:18.744-04:00Crash IE6: With HTML!Any serious client-side web developer has managed to crash a browser with some string of complex JavaScript, XSLT transform, or ActiveX Object. But what about with just some good old HTML?! Certainly a sixth-generation browser with several years on the market, such as Internet Explorer 6 could not be brought to its knees with some simple HTML. Well, guess again.<br /><br />Ponder the HTML below and see if you can guess what evil it possesses:<br /><br /><div><br /><div><a name="input1"/><input name="input1"/></div><br /><div><a name="input2"/><input name="input2"/></div><br /></div><br /><br /><br />I mean that looks perfectly safe and sane to me. Well, not to IE6. See, IE6 does not like self-closing anchor tags. But, instead of dropping the tag from the DOM, or adding an immediate </a> to correct the problem, it must do something completely different, because IE6 will crash when it stumbles upon this code.<br /><br />I spent an hour of trial and error, searching for the culprit, before I isolated this code on one the web pages I was building. Not even for a split second did I suspect that it would be a bit of HTML causing IE6 to stop dead in the water.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.comtag:blogger.com,1999:blog-5860341593129072537.post-71637417278905143402007-07-12T13:06:00.000-04:002007-07-20T00:11:56.390-04:00AJAX: Asynchronous?<span style="font-weight: bold;">Asynchronous?<br /></span><span><br /></span><span>S</span><span>o</span><span> AJAX stands for Asynchronous JavaScript and XML. As a technology, it sounds perfect for supporting client-server communications for fat-client web applications. But is it really? I mean, it is 'asynchronous' and it's HTTP, right? Well, not totally...<br /><span><br /></span></span>While the XMLHTTPRequest object does make an asynchronous call to the back-end server, these calls in themselves are not asynchronous on the TCP layer, only at thread-level are they asynchronous. Therefor, the calls themselves are synchronized and prone to being queued.<br /><br />According to HTTP 1.1 specifications, only two connections are supported per process. Internet Explorer sticks to this limitation, while other browser such as Firefox support a higher connection limit by default. The means that requests get queued if there is more than the browser limit already active.<br /><br />When requests queue up, long requests will block other requests, including images, javascript and css file calls. So, if you really want an asynchronous call system, AJAX is not the solution. But most likely a piece of the total solution.Jamie Hallhttp://www.blogger.com/profile/13301151990826211724noreply@blogger.com0