![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: Feb 2004
Location: California
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Again at w3schools.com...
![]() In the XPath tut, they had some "try it yourself" code that kinda irked me. I am unfamiliar with VB and ASP, which is what this looks like: Code:
<html>
<body>
<script type="text/vbscript">
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("cdcatalog.xml")
path="/catalog/cd/price"
set nodes=xmlDoc.selectNodes(path)
for each x in nodes
document.write("<xmp>")
document.write(x.xml)
document.write("</xmp>")
next
</script>
</body>
</html>
-S [edit] I'm guessing that Code:
set nodes=xmlDoc.selectNodes(path) Code:
function sayHi(message){
alert(message)
}
sayHi("Hello")
Again, I'm new to this, so bear with me. [edit] Last edited by Steveo31; 03-04-2004 at 06:24 PM.. |
|
|
|
|
|
PM User | #2 |
|
Regular Coder ![]() Join Date: Jun 2002
Location: Newcastle, England
Posts: 178
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
set xmlDoc=CreateObject("Microsoft.XMLDOM") is VBscript. The JScript (Microsoft's implementation of javascript) equivalent is xmlDoc = new ActiveXObject("Microsoft.XMLDOM"). Look this up in a JScript tutorial but bear in mind that it will only work in IE.
patrick |
|
|
|
|
|
PM User | #4 | |
|
Senior Coder ![]() Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,104
Thanks: 1
Thanked 28 Times in 28 Posts
![]() |
Quote:
__________________
I am the luckiest man in the world |
|
|
|
|
|
|
PM User | #5 | |
|
New to the CF scene Join Date: May 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Quote:
Code:
path="/catalog/cd/price"
__________________
Luke Redpath |
|
|
|
|
|
|
PM User | #6 | |
|
New Coder ![]() Join Date: Feb 2004
Location: California
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Quote:
![]() </stoopid> |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|