I am one of the developers of TryAgain , a Firefox add-on that displays a custom error page when a website fails to load. It essentially replaces Firefox netError.xhtmlwith an individual version.
However, I ran into some problems with terminal compatibility between 3.0. * - 3.6. * and Fx4b5. (The entry in netError.dtd has been renamed, causing an XML parsing error in both one and the other version.)
To fix this, I decided that the extension dynamically changes the page, as opposed to completely replacing it. One of the elements that I need to add to netError.xhtmlin Fx3 is <xul:button>. However, adding it with the following code, nothing is displayed on the screen:
var div = document.getElementById("errorContent");
var btn = document.createElement("xul:button");
btn.setAttribute("label", "Hello world");
btn.setAttribute("oncommand", "alert('Hello world!');");
div.appendChild(btn);
I see that in the Mozilla Developer Center there is this note :
Gecko's createElement implementation does not comply with the DOM specification for XUL and XHTML documents: localName and namespaceURI are not null for the created element. See error 280692 for more details .
What does this mean and how can I solve it?
Also, how can I execute the event oncommandthrough JavaScript?
source
share