如何在AdobeAIR中包含html文件?
如何在AdobeAIR的另一个HTML文件中包含常见的HTML模板文件,如页眉、页脚等 类似于SSI的东西:如何在AdobeAIR中包含html文件?,html,templates,air,include,adobe,Html,Templates,Air,Include,Adobe,如何在AdobeAIR的另一个HTML文件中包含常见的HTML模板文件,如页眉、页脚等 类似于SSI的东西: <!--#include file="header.shtml"--> 大概是这样的: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:XML i
<!--#include file="header.shtml"-->
大概是这样的:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:XML id="keyboard">
<keyboard><![CDATA[
<script type="text/javascript">
window.jQuery||document.write('<script type="text/'+'javascript" src="http:/'+'/ajax.googleapis.com'+'/ajax'+'/libs'+'/jquery'+'/1.8.0'+'/jquery.min.js"><'+'/script>');
</script>
<script type="text/javascript">
$(function() {
$('h1').css('color','red');
});
</script>
<style type="text/css">
h1{color:blue;}
</style>
<h1>html</h1>]]>
</keyboard>
</mx:XML>
<mx:Script>
<![CDATA[
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.events.Event;
import mx.controls.HTML;
[Bindable]
private function insertHtml():void {
browser.htmlLoader.window.document.write(keyboard.children());
}
]]>
</mx:Script>
<mx:HTML id="browser" location="http://www.w3.org" htmlDOMInitialize="insertHtml()" />
</mx:Application>
window.jQuery | | document.write(“”);
$(函数(){
$('h1').css('color','red');
});
h1{颜色:蓝色;}
html]]>
您还可以从文件中加载html
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:XML id="keyboard">
<keyboard><![CDATA[
<script type="text/javascript">
window.jQuery||document.write('<script type="text/'+'javascript" src="http:/'+'/ajax.googleapis.com'+'/ajax'+'/libs'+'/jquery'+'/1.8.0'+'/jquery.min.js"><'+'/script>');
</script>
<script type="text/javascript">
$(function() {
$('h1').css('color','red');
});
</script>
<style type="text/css">
h1{color:blue;}
</style>
<h1>html</h1>]]>
</keyboard>
</mx:XML>
<mx:Script>
<![CDATA[
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.events.Event;
import mx.controls.HTML;
[Bindable]
private function insertHtml():void {
browser.htmlLoader.window.document.write(keyboard.children());
}
]]>
</mx:Script>
<mx:HTML id="browser" location="http://www.w3.org" htmlDOMInitialize="insertHtml()" />
</mx:Application>