[jQuery] XUL jQuery-1.2.1 html manipulation issue
jQuery seems to have an issue with manipulating html when in a XUL
document.
The following code ( yes, the jquery is loaded, hence the
alert(jQuery)) crashes somewhere (there is no easy way of including
firebug in XUL) when processing the .html or .append functions and
blanks out the element.
It should change from FOOOOOO to BAAAAAAR when the button is clicked.
But as it is, it only clears the target out.
This sucks because I would really like to use jQuery in my XUL app for
ajax and ui manipulation.
-Carl
{{{
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id="main"
title="ToDo"
width="300"
height="300"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="margin:0;">
<html:script src="jquery-1.2.1.min.js"/>
<toolbox flex="1" style="margin:0;">
<html:div
id="todo-list"
style="background:#F0F0F0;"
flex="1">
FOOOOOOOOOOO
</html:div>
<html:script>
function replaceText(){
alert(jQuery);
$('#todo-list').html('BAAAAAAAAR');
}
</html:script>
<menubar id="sample-menubar">
<button label="CLICKME" oncommand="replaceText()"/>
</menubar>
</toolbox>
</window>
}}}