-1

I have js page. I need to get values from xml as,

37.220941081285 -76.650414191206 37.222866 -76.689166 37.221250370692 -76.69331520088 37.222969 -76.693565 37.226402 -76.694478 37.225778 -76.693886 37.223506 -76.693278 37.223218 -76.69235 37.22261 -76.678494 37.222866 -76.663581 37.221186 -76.650973 37.220941081285 -76.650414191206

but now i get values as,

[object Text]

How can I convert my [object Text] values to 37.220941081285 -76.650414191206 37.222866 -76.689166 37.221250370692 -76.69331520088 37.222969 -76.693565 37.226402 -76.694478 37.225778 -76.693886 37.223506 -76.693278 37.223218 -76.69235 37.22261 -76.678494 37.222866 -76.663581 37.221186 -76.650973 37.220941081285 -76.650414191206?

4

1 回答 1

0

It sounds like you're getting back a Text element. You can access the textual content of that element using .nodeValue.

E.g., assuming data is whatever variable you were outputting that gave you [object Text], you'd use:

var theText = data.nodeValue;

...to get the text within it.

于 2013-03-15T08:19:14.230 回答