Hi I'm trying to get the content on an HTML document to manipulate but am having problems using documentElement.
Is that only available when working with XML? If so, is there a way to do anything similar when fetch from an HTML webpage?
Here is my code:
var xhr = Ti.Network.createHTTPClient(); xhr.onload = function(){ if (this.status == 200) { var doc = this.responseText; var result = doc.documentElement; } }; xhr.open("GET","DOMAIN_NAME"); xhr.send();the variable
doc returns the contents of the website ok, but when I use doc.documentElement the variable result is empty, so using getElementsByID or anything else similar won't find anything.
3 Answers
You can always use WebView component. :)
HI,
i suppose this.responseTest returns string.
Ok thanks! I don't particularly want to do anything DOM, I know thats not possible. but in all the examples ive seen (including kitchensink) the way to process XML feeds is using these DOM operations. I thought I would ask if it was possible on HTML instead of XML.
Your Answer
Think you can help? Login to answer this question!