473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

IE equivalent of Firefox document.evaluate()

i've got this in firefox and it works

var xpath_result = document.evaluate("id('main')/tbody", document, null,
XPathResult.FIRST_ORDERED_NODE_TYPE, null );
var table = xpath_result.singleNodeValue;

what's the IE equivalent of it.

thx.


Aug 28 '06 #1
1 17310


ppcguy wrote:
i've got this in firefox and it works

var xpath_result = document.evaluate("id('main')/tbody", document, null,
XPathResult.FIRST_ORDERED_NODE_TYPE, null );
var table = xpath_result.singleNodeValue;

what's the IE equivalent of it.
It depends, if your document is an XML DOM document like IE gives you
with XMLHTTP as responseXML then you can do XPath queries with
selectNodes and selectSingleNode e.g.
var tbody = xmlDocument.selectSingleNode("id('main')/tbody");

If your document is a HTML document rendered in IE then there is no
XPath support (respectively no support for XPath over HTML).

That simply example however can be done with the Core and HTML DOM e.g.
var tableBody = document.getElementById('main').tBodies[0];
so I am not sure why you use XPath at all if that is an HTML document.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kim14 | last post by:
I have a table that works fine in IE, but doesn't work in Netscape or Firefox. It should automatically come up with numbers in some of the fields and depending what is entered, it should calculate...
3
by: Iain Hallam | last post by:
Hi. I've been using display:none on the style property of some <option> elements in my forms, which works fine with Mozilla - as expected it removes the option from my dropdown (although it...
7
by: Mark Szlazak | last post by:
Is there anything for Mozilla or Firefox that would be equivalent to IE's onpaste event for a textarea?
8
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
15
by: Dan | last post by:
Hi. I've got the following line of code which works fine in IE ... line_1_numbers = document.getElementsByTagName ('table').rows (0).cells (0).innerText; But it Firefox, it barks saying: ...
4
by: Laurent Compere | last post by:
Hi all, I try to make a logo fade in. I wrote the code below that is simple and supposed to be compatible with IE6,Firefox and Netscape. It works pretty well under IE6 but under Firefox and...
2
by: Trillium | last post by:
This seems like it should be really easy, but I cannot seem to make it work. I am trying to retrieve the text value of an element named "child2Element" from an XML file in a .NET (v 1.1) with an...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
2
by: Björn Langhof | last post by:
Hello. I want to evaluate a XPath-Expression only on a subtree of the whole xml-document. 1. I select a node of the XML-document 2. Then a want to select specific nodes below the node chosen...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.