<?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>Introspection &#187; javascript</title>
	<atom:link href="http://blog.jeffhaynie.us/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffhaynie.us</link>
	<description>Jeff Haynie on business and technology in Silicon Valley</description>
	<lastBuildDate>Mon, 01 Feb 2010 18:32:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Titanium Mobile at Mountain View JavaScript meetup at Google</title>
		<link>http://blog.jeffhaynie.us/titanium-mobile-at-mountain-view-javascript-meetup-at-google.html</link>
		<comments>http://blog.jeffhaynie.us/titanium-mobile-at-mountain-view-javascript-meetup-at-google.html#comments</comments>
		<pubDate>Sat, 18 Jul 2009 18:29:24 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=370</guid>
		<description><![CDATA[I gave a talk this week at the Mountain View JavaScript meetup hosted by Google at the Google headquarters in Mountain View, California.  Thanks to Michael Carter who hosts this event on a monthly basis.  The event was also video recorded by Google and is being made available on Youtube, although I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I gave a talk this week at the <a href="http://javascript.meetup.com/9/">Mountain View JavaScript meetup</a> hosted by Google at the Google headquarters in Mountain View, California.  Thanks to Michael Carter who hosts this event on a monthly basis.  The event was also video recorded by Google and is being made available on Youtube, although I don&#8217;t yet have a URL for it.  Below are my slides from the talk, available on Slideshare.</p>
<div style="width:425px;text-align:left" id="__ss_1738370"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/jhaynie/mountain-view-july-javascript-meetup-at-google" title="Mountain View July JavaScript Meetup at Google">Mountain View July JavaScript Meetup at Google</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=julyjsmeetup-090718130319-phpapp02&#038;stripped_title=mountain-view-july-javascript-meetup-at-google" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=julyjsmeetup-090718130319-phpapp02&#038;stripped_title=mountain-view-july-javascript-meetup-at-google" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/jhaynie">Jeff Haynie</a>.</div>
</div>
<div style="height:10px;">&nbsp;</div>
<p>If you haven&#8217;t yet tried <a href="http://www.appcelerator.com">Appcelerator Titanium</a>, I would encourage you to do that now.  It&#8217;s a pretty awesome product and makes it much easier and faster to bring the world of desktop and mobile applications to Javascript / Web Developers.  Titanium Mobile provides a web platform for building native iphone and android applications using web technologies.</p>
<p>Today, Titanium Mobile is still in private beta. However, if you&#8217;d like early access, please email me or get in touch with me through <a href="http://twitter.com/jhaynie">Twitter</a> and I&#8217;ll be glad to activate you.</p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=370&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/titanium-mobile-at-mountain-view-javascript-meetup-at-google.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Service Oriented UI Architecture in the world of web, desktop and mobile applications</title>
		<link>http://blog.jeffhaynie.us/service-oriented-ui-architecture-in-the-world-of-web-desktop-and-mobile-applications.html</link>
		<comments>http://blog.jeffhaynie.us/service-oriented-ui-architecture-in-the-world-of-web-desktop-and-mobile-applications.html#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:49:34 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ria]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=308</guid>
		<description><![CDATA[I gave a talk last night (December 2, 2008) at the SD Forum&#8217;s Java SIG in Palo Alto, CA.
The subtitle of the presentation was: &#8220;How the web has gone beyond the browser and we’re headed back to Client/Server&#8221;.  I&#8217;m including the presentation slides below:
SD Forum Java SIG &#8211; Service Oriented UI Architecture
View SlideShare presentation [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I gave a talk last night (December 2, 2008) at the <a href="http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&#038;eventID=13241&#038;pageId=471">SD Forum&#8217;s Java SIG</a> in Palo Alto, CA.</p>
<p>The subtitle of the presentation was: &#8220;How the web has gone beyond the browser and we’re headed back to Client/Server&#8221;.  I&#8217;m including the presentation slides below:</p>
<div style="width:425px;text-align:left" id="__ss_813836"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/jhaynie/sd-forum-java-sig-service-oriented-ui-architecture-presentation?type=powerpoint" title="SD Forum Java SIG - Service Oriented UI Architecture">SD Forum Java SIG &#8211; Service Oriented UI Architecture</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=sdforumjava120208-1228321750248283-8&#038;stripped_title=sd-forum-java-sig-service-oriented-ui-architecture-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=sdforumjava120208-1228321750248283-8&#038;stripped_title=sd-forum-java-sig-service-oriented-ui-architecture-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" href="http://www.slideshare.net/jhaynie/sd-forum-java-sig-service-oriented-ui-architecture-presentation?type=powerpoint" title="View SD Forum Java SIG - Service Oriented UI Architecture on SlideShare">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/web">web</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/ajax">ajax</a>)</div>
</div>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=308&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/service-oriented-ui-architecture-in-the-world-of-web-desktop-and-mobile-applications.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing Appcelerator</title>
		<link>http://blog.jeffhaynie.us/introducing-appcelerator.html</link>
		<comments>http://blog.jeffhaynie.us/introducing-appcelerator.html#comments</comments>
		<pubDate>Wed, 31 Oct 2007 04:13:59 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[Hakano]]></category>
		<category><![CDATA[Seam(less)]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=175</guid>
		<description><![CDATA[It&#8217;s been a little over a year and 4 months since Nolan and I started Hakano after the acquisition of Vocalocity.  We have spent a lot of time during the past year trying to help a few companies build and launch rich Internet applications.  It was hard and painful in the beginning.  [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It&#8217;s been a little over a year and 4 months since Nolan and I started <a href="http://www.hakano.com">Hakano</a> after the acquisition of <a href="http://www.vocalocity.com">Vocalocity</a>.  We have spent a lot of time during the past year trying to help a few companies build and launch rich Internet applications.  It was hard and painful in the beginning.  And, early on, we decided it was just still too hard to do interesting stuff these days.  Javascript really sucks, and the cross-browser issues are a killer.  Being software guys, we really wanted to solve the problem using a platform approach to the problem.  That&#8217;s just the way we think, it&#8217;s our DNA.</p>
<p>Late last year, after spending the summer and Fall building some web2.0-style applications and struggling with tons of Javascript, stomping on each others variables (yeah, we eventually moved to namespacing in JS), playing with lots of javascript/ajax frameworks and learning the hard way about how to do complex RIAs in a lopsided browser world &#8211; we decided to build something to help solve the problem. We code named it Seamless and developed it with a few customers that were gracious enough to provide us with interesting enterprise projects that benefited from next-generation web features.  We&#8217;ve continued to refactor it over and over this past year and today, I&#8217;m proud to announce that we&#8217;ve officially launched the product and company as <a href="http://www.appcelerator.com">Appcelerator</a>.</p>
<p>Appcelerator is a name that signifies what we want to accomplish: <strong>More App. Less Code</strong>.  It takes way too much code to do interesting web applications that push the limits of great user experience and a rich-application feel.  And, throw in a little requirement to support IE6, IE7, Opera, Firefox, Safari, iPhone, Camino and a ton of other mutations and variations &#8211; and you&#8217;ve got entirely too complex of situation for even the most talented web developer.</p>
<p>There&#8217;s a lot of approaches out there.  And ours is different and we think it revolutionizes the way people develop web applications today.  We think model-view-controller (MVC) is no longer the best approach to building SOA-enabled web applications.  We believe that SOA should include Service-Oriented Application architectures &#8211; a lot like the good old days of Client-Server.  We believe that there should be a clean separation between the application and the services the application uses.  And, the service should be developed with a clean contract and be available to different types of applications.  Some people would call that a mashup (and if you get really fancy, an &#8220;enterprise mashup&#8221;) &#8211; where you can integrate multiple services  using disparate pieces of information interwoven into a useful app.  We think this is really just good SOA design.  If you develop your services in an SOA architecture &#8211; and then cleanly separate your application from those services &#8211; you&#8217;ll get mashup capabilities out-of-the-box.  It will also be much easier to layer cross-cut concerns across your architecture &#8211; such as security, auditing, governance, aggregation and composition and complex work flow &#8211; to name a few.</p>
<p>Separation also has the benefit of separation of concerns from a workforce standpoint.  OK, we&#8217;ve been talking about this for a long-time &#8211; especially in the Java EE world.  But have we realized this yet?  No, c&#8217;mon.  We still work with a designer (generally) to wireframe the design, we turn that into a page template (dependent on the server-side framework in use) and then we wire it up with our controllers (if you&#8217;re really good, otherwise, you just code it all inline) and call them &#8220;views&#8221;.  Yea, right, &#8220;views&#8221; &#8211; nothing more than a fancy word for something that was really invented for tightly coupled graphical user interfaces of yesteryear.  In Appcelerator, you have true separation between the application and services that the application interacts with.</p>
<p>Additionally, service-level separation provides a good demarcation for contract-driven programming (or as some might say, interface-driven programming but without real language interfaces).  When you can cleanly separate services &#8211; you can now independently develop the application from its services &#8211; and even switch out those services underneath the cover (sounds like SOA, huh)?  For example, application development can progress even before integration of services has even commenced &#8211; or can run in parallel.  You can even completely mock out the entire application without any real back end services &#8211; which is how we recommend you do it &#8211; such that the user interface becomes true use-case driven development.  And it&#8217;s very iterative &#8211; unlike traditional MVC where you have to re-templatize, re-wire and then re-integrate code for every UI change.</p>
<p>There are so many other great things about what we&#8217;re doing &#8211; way too many to discuss in one blog post. So, I&#8217;ll spread them out here and on our new developer community blog just launched, called <a href="http://www.appcelerant.com" title="Appcelerant Blog">Appcelerant</a> (get it, rant!).  Stop by sometime and subscribe with your RSS reader &#8211; we&#8217;ll be having some fun and interesting discussion over there.</p>
<p>A little bit about the company and the model.  We&#8217;ve released <a href="http://www.appcelerator.org/download.html" title="Get your copy of Appcelerator">Appcelerator</a> under a GPL version 2 license and our business model is a traditional professional open source model.  We&#8217;ll be offering strategic consulting, training, commercial licensing and a subscription model for support.</p>
<p>We also have grown quite a bit since we started. We&#8217;re now at 12 employees and we have some very interesting people that are joining our team very soon that I can&#8217;t wait to talk about.</p>
<p>We have a good bit of work to do to really round out the product and community. We&#8217;d really like your feedback and support.  If you&#8217;d like to join the community, please do so at <a href="http://www.appcelerator.org">http://www.appcelerator.org</a>.  The <a href="http://www.appcelerator.org/register.html" title="Register for Appcelerator Community">first 250 people to join</a> will get a special gift and forever be known as &#8220;Early Appdopters&#8221;.   Come out and support us and you&#8217;ll forever be famous (at least in our eyes).</p>
<p><a href="http://technorati.com/tag/appcelerator" rel="tag" class="techtag">appcelerator</a> <a href="http://technorati.com/tag/ria" rel="tag" class="techtag">ria</a> <a href="http://technorati.com/tag/soa" rel="tag" class="techtag">soa</a> <a href="http://technorati.com/tag/atlanta" rel="tag" class="techtag">atlanta</a> <a href="http://technorati.com/tag/web2.0" rel="tag" class="techtag">web2.0</a> <a href="http://technorati.com/tag/hakano" rel="tag" class="techtag">hakano</a></p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=175&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/introducing-appcelerator.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross-browser way to dynamically load javascript</title>
		<link>http://blog.jeffhaynie.us/cross-browser-way-to-dynamically-load-javascript.html</link>
		<comments>http://blog.jeffhaynie.us/cross-browser-way-to-dynamically-load-javascript.html#comments</comments>
		<pubDate>Thu, 06 Sep 2007 04:35:34 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=164</guid>
		<description><![CDATA[
This has been a popular post. However, I&#8217;d urge you to first checkout Appcelerator as a better alternative to doing this by hand.

I have been doing a lot of cross-browser javascript coding in the past 6 months.  It&#8217;s not fun, very miserable in fact.  Most of the time, Firefox, Safari and Opera work [...]]]></description>
			<content:encoded><![CDATA[<p></p><div style="background-color:#ffffcc;border:1px solid #ffff77;padding:10px;margin-bottom:20px;">
This has been a popular post. However, I&#8217;d urge you to first checkout <a href="http://www.appcelerator.org">Appcelerator</a> as a better alternative to doing this by hand.
</div>
<p>I have been doing a lot of cross-browser javascript coding in the past 6 months.  It&#8217;s not fun, very miserable in fact.  Most of the time, Firefox, Safari and Opera work without much effort and differences between the 3.  However, throw IE into the mix and you&#8217;re in a whole different world.  Most people don&#8217;t really appreciate how much different &#8211; and non-compliant &#8211; Microsoft&#8217;s browser(s) are.  In fact, IE6 is probably 100 times worse than IE7.  But, IE7 has it&#8217;s own problems as well.</p>
<p>Here&#8217;s how you can dynamically load an external javascript source file at runtime (from javascript).  This is helpful if you need to dynamically inject javascript.   And, the biggest problem was setting a function that you want executed after the script is loaded.  Normally, this is done by setting the onload property to a javascript function which will be invoked after the external javascript file is loaded.  However, like most things MSIE, you have to do it a little differently.</p>
<p>Here&#8217;s the cross-browser code:</p>
<p style="border: 1px dotted #aaaaaa; padding: 6px; background-color: #eeeeee"> <code><br />
var script = document.createElement('script');<br />
script.setAttribute('src','myjavascriptfile.js');<br />
script.setAttribute('type','text/javascript');<br />
var loaded = false;<br />
var loadFunction = function()<br />
{<br />
if (loaded) return;<br />
loaded=true;<br />
// your code goes here<br />
alert('your JS file is now loaded');<br />
};<br />
script.onload = loadFunction;<br />
script.onreadystatechange = loadFunction;<br />
</code></p>
<p>On all browsers except IE, onload works properly.  However, on IE, you&#8217;ll need to use the property onreadystatechange.</p>
<p>I&#8217;ve tested this on the following browsers:</p>
<p>Safari &#8211; Mac and Windows<br />
Opera &#8211; Mac and Windows<br />
Firefox &#8211; Mac and Windows<br />
Camino &#8211; Mac<br />
IE6/IE7 &#8211; Windows</p>
<p><img src="http://freehogg.files.wordpress.com/2006/04/technorati.gif" id="image329" alt="Technorati" /> technorati tags: <a href="http://www.technorati.com/tags/javascript" rel="tag">javascript</a>, <a href="http://www.technorati.com/tags/crossbrowser" rel="tag">crossbrowser</a></p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=164&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/cross-browser-way-to-dynamically-load-javascript.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Seam(less) Web Application Framework Released</title>
		<link>http://blog.jeffhaynie.us/seamless-web-application-framework-released.html</link>
		<comments>http://blog.jeffhaynie.us/seamless-web-application-framework-released.html#comments</comments>
		<pubDate>Wed, 03 Jan 2007 04:59:18 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Seam(less)]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=56</guid>
		<description><![CDATA[Today, we introduced the Seam(less) web application framework.  The project uses the open source Apache Software License, version 2.0 for flexibility.  You can download Seam(less) from Sourceforge.  We have also setup a Google discussion group.
We started Seam(less) because we believe that Ajax has enabled much more than rich web client interfaces.  [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Today, we introduced the <a href="http://www.hakano.org/introducing-seamless.html">Seam(less) web application framework</a>.  The <a href="http://www.sourceforge.net/projects/seamless-web">project</a> uses the open source <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License, version 2.0</a> for flexibility.  You can download Seam(less) from <a href="http://sourceforge.net/project/showfiles.php?group_id=184499">Sourceforge</a>.  We have also setup a Google <a href="http://groups.google.com/group/seamless-web?hl=en">discussion group</a>.</p>
<p>We started <strong>Seam(less)</strong> because we believe that <a href="http://en.wikipedia.org/wiki/AJAX">Ajax</a> has enabled much more than rich web client interfaces.  We believe it has paved the way for a paradigm shift in web programming &#8211; a shift away from <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a>-based frameworks towards lightly coupled Client/Server-based frameworks.<span id="more-56"></span></p>
<p>We believe these next generation frameworks should have the following characteristics:</p>
<ul>
<li><strong> Server language independence</strong></li>
</ul>
<blockquote><p>Developers should be able to use any language for sever development (e.g., Java, Ruby, PHP or .NET) and this choice should not impact the development of the user interface in any way or vice versa.</p></blockquote>
<ul>
<li><strong> Integrate the Client and Server via a lightweight, language independent message protocol</strong></li>
</ul>
<blockquote><p>You should be able to develop client and server components independently.  The contract between the client and the server should be a very simple message-based protocol.  This is the primary principle behind a <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">Service Oriented Architecture</a> (SOA), and we believe it&#8217;s mandatory if you want to rapidly build and deploy web-based services.</p>
<p>You should also be able to develop fully functional client prototypes without writing a single line of server code.  Furthermore, client prototypes should be convertible into production clients with little to no change.</p></blockquote>
<ul>
<li><strong></strong><strong> Leverage Ajax and DHTML without Javascript</strong></li>
</ul>
<blockquote><p>Using Ajax and DHTML requires a significant amount of Javascript.  We believe that rich client functionality should be possible without writing a single line of Javascript, but there should be Javascript-based hooks available for developers that desire more control.</p></blockquote>
<ul>
<li><strong></strong><strong> Cross-browser Support</strong></li>
</ul>
<blockquote><p>Application developers should not have to worry about the complexities of running an application across multiple web browser products and versions.</p></blockquote>
<p>With these characteristics in mind, we developed Seam(less).  We&#8217;ve been using the framework for almost six months.  It has been used on all of our projects since its development, and it has saved us hundreds of hours in development time.</p>
<p>We decided it was time to give Seam(less) to the community.  We hope you enjoy using it as much as we have.  We welcome any suggestions, comments or contributions that you would like to make. We will continue to update this site with examples that demonstrate how to use the Seam(less) framework.</p>
<p><img id="image329" src="http://freehogg.wordpress.com/files/2006/04/technorati.gif" alt="Technorati" /> technorati tags: <a href="http://www.technorati.com/tags/seamless" rel="tag">seamless</a>, <a href="http://www.technorati.com/tags/javascript" rel="tag">javascript</a>, <a href="http://www.technorati.com/tags/ajax" rel="tag">ajax</a>, <a href="http://www.technorati.com/tags/web2.0" rel="tag">web2.0</a>, <a href="http://www.technorati.com/tags/programming" rel="tag">programming</a></p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=56&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/seamless-web-application-framework-released.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XUL enhanced by Prototype</title>
		<link>http://blog.jeffhaynie.us/xul-enhanced-by-prototype.html</link>
		<comments>http://blog.jeffhaynie.us/xul-enhanced-by-prototype.html#comments</comments>
		<pubDate>Wed, 03 Jan 2007 00:03:04 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=55</guid>
		<description><![CDATA[We use Prototype in our projects when developing AJAX applications.  We recently started a project with a customer that is porting their Flash-based product to one that is primarily driven from Mozilla&#8217;s XUL framework.  XUL has an entire framework for building cross-platform UIs &#8211; it&#8217;s mostly only for Mozilla-based browsers, although others have [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>We use <a href="http://prototype.conio.net/">Prototype</a> in our projects when developing AJAX applications.  We recently started a project with a customer that is porting their Flash-based product to one that is primarily driven from <a href="http://www.mozilla.org/projects/xul/">Mozilla&#8217;s XUL</a> framework.  XUL has an entire framework for building cross-platform UIs &#8211; it&#8217;s mostly only for Mozilla-based browsers, although others have tried to use the <a href="http://xulblog.de/xul/archives/20-Trick-17-with-XUL-and-IE.html">XUL spec to run in other browsers</a>.</p>
<p>I was planning on leveraging the Prototype library &#8211; the same that we do in typical web applications.  The basics worked fine &#8211; until we ran into a pretty trivial prototype requirement &#8211; AJAX requests.  You gotta love fun errors like the following:</p>
<blockquote><p>
   TypeError: this.transport.onreadystatechange.bind is not a function
</p></blockquote>
<p>Geez, thanks &#8211; that was very helpful.</p>
<p>After summoning google to do a little research for me, I found a year <a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-January/002254.html">old post</a> in a <a href="http://www.rubyonrails.org/">Ruby on Rails</a> mailing list with someone having a similar problem.  Luckily, I found a patched version of Prototype 1.4 that has all the fixes.  Basically, in Mozilla there is a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=300079">very old bug</a> that doesn&#8217;t allow you to add new methods dynamically to Function or Regexp. [1],[2] This new patched Prototype will replace all the bind methods on objects with a new generic bind method that does that same job as an anonymous javascript function reference.</p>
<p><a id="p57" href="http://blog.jeffhaynie.us/wp-content/uploads/2007/01/prototype_for_xul.js">Download the XUL for Javascript fix</a></p>
<p><img id="image329" src="http://freehogg.wordpress.com/files/2006/04/technorati.gif" alt="Technorati" /> technorati tags: <a href="http://www.technorati.com/tags/xul" rel="tag">xul</a>, <a href="http://www.technorati.com/tags/prototype" rel="tag">prototype</a>, <a href="http://www.technorati.com/tags/javascript" rel="tag">javascript</a></p>
<p>[1] <a href="http://groups.google.com/group/netscape.public.mozilla.jseng/browse_thread/thread/333a37784e94bfb1/a11efcdd083031e2?lnk=st&#038;q=xul+function+prototype+group%3Anetscape.*&#038;rnum=3&#038;hl=en#a11efcdd083031e2">Mozilla Group Discussion</a><br />
[2] <a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-January/002254.html">Mozilla Group Discussion</a></p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=55&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/xul-enhanced-by-prototype.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dynamic CSS in Microsoft IE</title>
		<link>http://blog.jeffhaynie.us/dynamic-css-in-microsoft-ie.html</link>
		<comments>http://blog.jeffhaynie.us/dynamic-css-in-microsoft-ie.html#comments</comments>
		<pubDate>Thu, 14 Dec 2006 05:48:16 +0000</pubDate>
		<dc:creator>Jeff Haynie</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.jeffhaynie.us/?p=44</guid>
		<description><![CDATA[Microsoft IE is such a pain some time.  I&#8217;ve been trying to create a dynamic stylesheet &#8211; one whereby the contents of the stylesheet are dynamic and not known at page load time.  This is web2.0, isn&#8217;t it?
In Firefox, Opera and Safari it seems I can create a style object and then append [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Microsoft IE is such a pain some time.  I&#8217;ve been trying to create a dynamic stylesheet &#8211; one whereby the contents of the stylesheet are dynamic and not known at page load time.  This is web2.0, isn&#8217;t it?</p>
<p>In Firefox, Opera and Safari it seems I can create a style object and then append content to it and simply append it to HEAD using DOM.  However, in IE, if you try that, you&#8217;ll simply get an exception.  I&#8217;ve tried several attempts before I came up with this solution that seems to work fine.</p>
<p>You can use this <a href="js/ie_style_hack.js">snippet of code</a> for creating a IE based stylesheet.</p>
<p>You&#8217;ll need to then define to variables used within the code:</p>
<p>   1. styleCSS &#8211; this is the CSS code<br />
   2. head &#8211; this is the DOM element for head. This can also be any DOM element you&#8217;d like to insert the CSS into</p>
<p>In the code above, I&#8217;m using the <a href="http://prototype.conio.net/">prototype</a> JS library for one fraction of code for splitting and iterating over the individual rules.</p>
<p><img id="image329" src="http://freehogg.wordpress.com/files/2006/04/technorati.gif" alt="Technorati" /> technorati tags: <a href="http://www.technorati.com/tags/javascript" rel="tag">javascript</a>, <a href="http://www.technorati.com/tags/msie" rel="tag">msie</a>, <a href="http://www.technorati.com/tags/css" rel="tag">css</a></p>
<img src="http://blog.jeffhaynie.us/?ak_action=api_record_view&id=44&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.jeffhaynie.us/dynamic-css-in-microsoft-ie.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
