javascript - Why isn't document.evaluate working? -
I'm using it in the Firefox extension and can not get it to work.
all allLinks = document.evaluate ('// one [@ auf]', window.document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, empty); Window.alert (allLinks); This alert [Object XPathResult] . Although always gives 0 in the following (and of course there are links on the page).
window.alert (allLinks.snapshotLength);
If this Firefox is specific and I believe that you only use the new version Can you do this when the DOM is completely loaded?
to do this DOMContentLoaded or something else.
Documents. AddEventListener ('DOMContentLoaded', fn, false); Edit: Your XP works for me Is it in the console on the current, loaded page, before anything is present you are inquiring .
Comments
Post a Comment