createEntityReference (W3C DOM Core method)
var reference = document.createEntityReference('amp');
The example above creates an entity reference called
amp, which would be written in HTML as
& and decodes as the entity
- name (
The name of the entity to reference.
EntityReference node in an XML document, of the specified
The created entity reference node
Opera doesn't implement this method (it returns undefined).
Firefox implements this
method but it returns
says that this method should throw a
in HTML mode1 (code 9:
Therefore if a browser supports it and does not throw an exception in that
mode, this is considered a bug, and is what happens in Safari
1.3 and 2.
Internet Explorer in HTML doesn't implement this method at all; but there's no reason why it should (because even if it did, it shouldn't work, as per the previous note), so this is not considered a lack of support.
1 On XHTML or HTML pages served as
There are no comments yet.