[OpenAjaxIDE] <require type="inline">

Kin Blas jblas at adobe.com
Thu Aug 27 23:01:57 PDT 2009


During the 03/31/2009 IDE phone call I had mentioned that there was a need to extend the widget metadata so that singleton content could be added to the head:


Kin: As a separate issue, we need a way to include singleton content into the head. Particularly needed in order to insert things for IE5 and IE6.

Jon: I think that's a good feature. A generalization of inline type=javascript and type=css. But what's the markup? I was thinking REQUIRE type=inline

Kin: I like that.

It seems this didn't make it into the spec. Just to refresh folks memory, according to the current version of the spec, we can only insert "inline" JavaScript and CSS <require> content:


<require type="javascript"><![CDATA[ /* YOUR JS GOES HERE */ ]]></require>
<require type="css"><![CDATA[ /* YOUR CSS GOES HERE */ ]]></require>


Which results in this being inserted into your document:

                <head>
                ...
<script type="text/javascript">
/* YOUR JS GOES HERE */
</script

<style type="text/css">
/* YOUR CSS GOES HERE */
</style>
...
</head>


There is currently no way to insert singleton markup into the document head. This is what <require type="inline"> was supposed to allow. So for example, you could use it to insert IE conditional comments:

<require type="css" src="myWidget.css" />
<require type="javascript" src="myWidget.js" />
<require type="inline">
<![CDATA[
<!--[if IE]>
<script type="text/javascript" src="myWidgetIEHacks.js"></script>
<link href="myWidgetIEHacks.css" rel="stylesheet" type="text/css" />
<![endif]-->
]]>
</require>

Which would result in the inline content being inserted into the document relative to the other requires:

<head>
...
<script type="text/javascript" src="myWidget.js"></script>
<link href="myWidget.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<script type="text/javascript" src="myWidgetIEWorkarounds.js"></script>
<link href="myWidgetIEWorkarounds.css" rel="stylesheet" type="text/css" />
<![endif]-->
...
</head>

We'd like to see this make it into the 1.0 version of the spec as we have already implemented support for this <require> type and will depend on it as a mechanism that allows us to add singleton markup to the <head> of the document for IE workarounds.

--== Kin ==--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090827/8a72f262/attachment-0001.html 


More information about the IDE mailing list