Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在AdobeAIR中包含html文件?_Html_Templates_Air_Include_Adobe - Fatal编程技术网

如何在AdobeAIR中包含html文件?

如何在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

如何在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 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>