{"id":213,"date":"2009-03-18T17:39:15","date_gmt":"2009-03-19T01:39:15","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=213"},"modified":"2009-04-15T20:49:24","modified_gmt":"2009-04-16T04:49:24","slug":"whats-dhtml-compilation-good-for","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2009\/03\/18\/whats-dhtml-compilation-good-for\/","title":{"rendered":"What&#8217;s DHTML Compilation Good For?"},"content":{"rendered":"<p>OpenLaszlo allows you to compile applications to SWF8, SWF9 or DHTML. Recently I&#8217;ve heard people ask, &#8220;why would you want to compile an application to DHTML?&#8221;<\/p>\n<p>When you think about it, that&#8217;s not a silly question at all. Regardless of whether you compile an OpenLaszlo application to SWF or DHTML, you&#8217;ll have similar benefits and simliar constraints. On the positive side, coding complex and interactive user interfaces is straightforward. You&#8217;re using a language that was specificially designed for rich Internet applications (RIAs).<\/p>\n<p>However, many of the problems people associate with SWF &#8211; inability to bookmark (what exactly?), lack of search engine exposure, back button integration (you want to try explaining what&#8217;s supposed to happen when you click back in a RIA), difficulty of integration with traditional HTML applications &#8211; affect DHTML-compiled OpenLaszlo applications too. Thankfully these days, most developers understand that a platform like OpenLaszlo isn&#8217;t supposed to replace HTML applications, but instead is intended for a specific type of application that&#8217;s difficult, if not impossible, to do with HTML. Think <a href=\"http:\/\/www.gliffy.com\/\" target=\"_blank\">Gliffy<\/a>.<\/p>\n<p>So if DHTML doesn&#8217;t solve some of most long-standing &#8220;problems&#8221; of Flash, what does it offer? Certainly not media support; in fact SWF-compiled OpenLaszlo applications have more consistent support for PNG, as well as FLV, SWF, MP3.<\/p>\n<p>Surely DHTML-compiled OpenLaszlo applications must offer some other benefits then? Well, they work in Webkit, which means they&#8217;ll <a href=\"http:\/\/weblog.openlaszlo.org\/archives\/2007\/07\/our-first-iphone-app\/\" target=\"_self\">run on the iPhone<\/a> (and of course many upcoming mobile devices that use DHTML). That&#8217;s definitely an advantage, but the applications are still limited by the performance of the small CPU.<\/p>\n<p>So now we get to where DHTML compilation really shines&#8230; Remember how I said that OpenLaszlo was good for some applications, and HTML was good for others? DHTML-compilation in OpenLaszlo allows you to run one or more HTML applications <em>inside<\/em> your OpenLaszlo application!<\/p>\n<p>How can it do this? By using the &lt;html&gt; tag, you can embed another web property (e.g. a web site, HTML-based application) inside your OpenLaszlo application. Here&#8217;s an <a href=\"\/blogsupport\/dhtmlcompilation\/\" target=\"_blank\">example<\/a> that shows two HTML web sites embedded in the same OpenLaszlo application:<\/p>\n<figure id=\"attachment_215\" aria-describedby=\"caption-attachment-215\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"\/blogsupport\/dhtmlcompilation\/\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-215\" title=\"Screenshot of two HTML applications in one OpenLaszlo application\" src=\"http:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2009\/03\/screenshot.png\" alt=\"Screenshot of two HTML applications in one OpenLaszlo application\" width=\"500\" height=\"305\" srcset=\"https:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2009\/03\/screenshot.png 885w, https:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2009\/03\/screenshot-300x183.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-215\" class=\"wp-caption-text\">Screenshot of two HTML applications in one OpenLaszlo application<\/figcaption><\/figure>\n<p>Unfortunately, I can&#8217;t simply embed this example into my blog, because it relies on the OpenLaszlo wrapper code. You have to click the screenshot above and then play with the windows.<\/p>\n<p>You may be aware that SWF-compilation also supports the &lt;html&gt; tag. However, the problem with using the &lt;html&gt; tag with a SWF-compiled OpenLaszlo application is that the IFRAME which displays the HTML web site will always float above the SWF. That means you can&#8217;t really have a windowed application, unless you&#8217;re satisfied with only having one window in your entire application. And you can&#8217;t have two &lt;html&gt; tags, if they&#8217;re likely to ever overlap, since there&#8217;s no way to control which is on top at any one point.<\/p>\n<p>As you can see, that&#8217;s not a problem for DHTML.<\/p>\n<p>Download the <a href=\"\/blog\/wp-content\/uploads\/2009\/04\/iframesanddivs.zip\">source<\/a> for this example.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>OpenLaszlo allows you to compile applications to SWF8, SWF9 or DHTML. Recently I&#8217;ve heard people ask, &#8220;why would you want to compile an application to DHTML?&#8221; When you think about it, that&#8217;s not a silly question at all. Regardless of whether you compile an OpenLaszlo application to SWF or DHTML, you&#8217;ll have similar benefits and &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2009\/03\/18\/whats-dhtml-compilation-good-for\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">What&#8217;s DHTML Compilation Good For?<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":5,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}