Two part question:
1) How do you inject a script (for example 'library.js') to the HTML DOM when making an XUL extension?
2) I currently have a toolbar button which I want to call a function in 'library.js' when the button is clicked.
Here is my current XUL for the toolbar button
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="myextension-button"
class="toolbarbutton-1"
image="chrome://xulschoolhello/skin/favicon.png"
oncommand="doStuff();"
label="label" tooltiptext="tooltip" />
</toolbarpalette>
Here is library.js (which will be injected into the DOM). Library.js will have a bunch of functions modifying the DOM. Here is one example:
function changeTheDOM(){
document.body.innerHTML = 'I changed it';
}
I want doStuff() to somehow call the function changeTheDOM(), which is in the HTML DOM. Let me know if that makes sense.
With all these different namespaces/context, its very difficult for me as a beginner to grasp how to interact between my application code and the DOM.