I need to open jQuery ui dialog by clicking the button in the Firefox toolbar (developed as the Firefox extension). I've added the .js files in the .xul file, but it doesn't work from some reason. I use the Mozilla Firefox 4. Here is my source code:
.xul file:
..
<script type="application/x-javascript" src="chrome://tuttoolbar/content/tuttoolbar.js" />
<script type="application/x-javascript" src="chrome://tuttoolbar/content/scripts/jquery-1.4.2.min.js" />
<script type="application/x-javascript" src="chrome://tuttoolbar/content/scripts/jquery-ui-1.8.4.custom.min.js"/>
...
<toolbarbutton id="Example" tooltiptext="UI Dialog" label="Open jQ dialog" oncommand="objTutorialToolbar.sayHello1(event); event.stopPropagation();"/>
tuttoolbar.js:
....
var objTutorialToolbar = {
......
sayHello1 : function(aEvent) {
var docUrl = window.content.document.location.href;
var div = document.createElement("div");
div.setAttribute("id", "dialog_dummy");
var body = document.getElementsByTagName("body").item(0);
body.appendChild(div);
$dialog = $('#dialog_dummy').html('').dialog(
{
title : 'Title',
modal : false,
autoOpen : false,
show : 'slide',
hide : 'slide',
url : docUrl,
height: 550,
width: 1050
});
$dialog.dialog("open");
},
...
}
Does somebody know where is the mistake in the code above?