2012-08-27 68 views
2

我想使用XULRunner製作一個離線應用程序。我正在嘗試將JSTree集成到樹視圖中。它似乎沒有調用外部js。該代碼在正常的html文件中正常工作。任何想法爲什麼它不在XULRunner中?我的XUL文件的代碼是這樣的:xulrunner調用外部javascript

<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
<window 
    id="findfile-window" 
    title="Find Files" 
    width="800" 
    height="500" 
    xmlns:html="http://www.w3.org/1999/xhtml" 
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
<!--General Use jQuery 
<script src="jquery/jquery-1.8.0.js"/>--> 

<!--jstree plugin--> 
<script src="jstree/_lib/jquery.js"/> 
<script src="jstree/jquery.jstree.js"/> 
<script> 
     $(document).ready(function(){ 
      $("#bibletree").jstree({ 
       "plugins" : [ "themes", "html_data" ], 
       "themes" : { 
        "icons" : false, 
        "dots" : false 
       } 
      }); 
     }); 
</script> 


     <html:div id="bibletree"> 
     <html:ul id="lvl"> 
      <html:li><html:a href="#">Genesis</html:a> 
       <html:ul> 
        <html:li><html:a href="#">01</html:a></html:li> 
        <html:li><html:a href="#">02</html:a></html:li> 
        <html:li><html:a href="#">03</html:a></html:li> 
        <html:li><html:a href="#">04</html:a></html:li> 
        <html:li><html:a href="#">05</html:a></html:li> 
        <html:li><html:a href="#">06</html:a></html:li> 
            ... 
</window> 
+0

它可能不起作用,因爲XUL使用[靈活盒佈局(http://www.w3.org/TR/css3-flexbox/)。或者,它可能是調用'document.createElement()'而不是'document.createElementNS()'。無論哪種方式,使用XUL樹可能更有意義,而不是嘗試使腳本不適用於XUL。您可以將該腳本加載到XHTML文檔中。 –

+0

所以我錯誤地認爲xulrunner的整個想法是使用javascript,html和css來創建/離線應用程序? – preahkumpii

+0

它比這更細緻,你確實使用js,html和css。這只是與xulrunner有時有所不同。 – tomdemuyt

回答