problem with code

J

Joel Allen

Hi,

I am having a problem with this code. I'm just trying to retrieve the value
of one of my fields on line 33:

var JobName = XDocument.selectSingleNode("my:JobName").text;

The error I get is:

The following error occurred:

Object doesn't support this property or method
File:script.js
Line:33

Do you see a problem with this code right off the bat?

Thanks,
Joel
 
R

Russ

You need to use XDocument.DOM.selectSingleNode
The DOM is the xml tree itself, so that's where you have to go to get at
nodes.
 
J

Joel Allen

Thanks for your reply Russ. I tried this and still got an error:

var JobName = XDocument.DOM.selectSingleNode("my:JobName").text;

The error says object required.

Thanks,
Joel
 
S

S.Y.M. Wong-A-Ton

The XPath expression to the "my:JobName" node is probably incorrect.
Double-check it and/or try using "//my:JobName" instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top