I have a webView in my Titanium mobile application that loads a login page, allows the user to log into the site, and then once the user has logged in and has loaded the main page, an XML file is loaded from a link on the web page. When the XML loads in the webView, I can see the elements of the XML listed out in the webView.
webView.addEventListener('load',function(e) { Ti.API.info('The URL changed to '+webView.url); if (webView.url == "****my main page url****") { Ti.API.info("Got the main page"); webView.hide(); webView.evalJS('window.location = "****my xml url****"'); } else if (webView.url == "****my xml url****") { Ti.API.info("XML Loaded"); parseXML(); } }); parseXML = function() { xmlContent = webView.getHtml(); Ti.API.info(xmlContent); }What I need to do is get this XML data out of the webView and parse it, and do various things with it. I can not seem to find a way to retrieve this out of the webView. I also tried:
xmlContent = webView.evalJS("document");I have no idea if that is the proper thing to do...but it didn't work.
Does anyone have a solution to this problem, or another way to work this without using a webView. The reason I am not fetching a file using XHR is that the site uses Digest authentication, which can not be done using XHR as far as I know.
2 Answers
I think it is not a problem to build the special http header. It is the same way lie with oauth.
Your Answer
Think you can help? Login to answer this question!