
documentElement.getElementsbyTagName("")[0] is not working in Firefox latest version. Is it a bug?
I am getting 'not defined' exception while using documentElement.getElementsbyTagName("data")[0] this method
Chosen solution
character 'ß' causes the issue.
Read this answer in context 👍 0All Replies (7)
Make sure that you spell it correctly:
documentElement.getElementsByTagName("data")[0];
You might still need document, e.g.,:
document.documentElement.getElementsByTagName("body")[0];
Thank you for the response.
I tried document.documentElement.getElementsByTagName("data")[0]; Still It doesn't work.
How many <data> tags do you have in the document?? If you select all, right-click, and View Selection Source, you can search in the source as modified by your scripts.
Is this an HTML or an XML document? What is your DOCTYPE declaration?
If you have a page online that demonstrates the problem, please provide a link so we can tackle it more efficiently.
Its XML document. I have one data tag.
I think we found the root cause. data is huge and there are words which contains special characters like S�or , 'Opéra etc., Firefox latest version is unable to parse XML which has this characters.
Either we need to escape these characters or remove the whole word. But still wondering how this works in Linux Firefox 7 and previous version and not in latest version ?.
Any other suggestion to fix this without escape these characters or remove the whole word?
Perhaps the behavior was changed to enforce standards more strictly. That sort of change has happened in the past. Or maybe it's a bug. Either way, answering questions about XML parsing probably is beyond the scope of this support forum. Perhaps try here:
mozillaZine Web Development board
It's a separate forum with separate registration. Please note the tips in the Sticky Post at the top of the forum before posting.
Chosen Solution
character 'ß' causes the issue.