I am trying to make an offline app using XULRunner. I am trying to integrate JSTree for a tree view. It doesn't appear to call the external js. The code works correctly in a normal html file. Any ideas why it doesn't in XULRunner? The code of my xul file is thus:
<?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>
Yes,
the document object does not have the onload or ready event in XUl, you will have to listen for 'load' in the 'window' object or use 'onload'.
Link: https://developer.mozilla.org/en-US/docs/XUL/Events#Window_events