Parsing the url in xml format to javascript

DrarieErancep

New Member
I am using sencha touch 2 to parse a .xml file to javascript. I have a question, when i parse a .xml file to javscript it can work.This is my the content of my users.xml file\[code\]<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xml:base="http://Something/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"><title type="text">IncidentSet</title><id>http://Something</id><updated>2012-06-06T03:11:06Z</updated><link rel="self" title="IncidentSet" href="http://stackoverflow.com/questions/11021322/IncidentSet" /><entry><id>http://something)</id><title type="text">(6/6)11:06 Roadworks on Somewhere</title><summary type="text"></summary><updated>2012-06-06T03:11:06Z</updated><author> <name /></author><link rel="edit" title="Incident" href="http://stackoverflow.com/questions/11021322/IncidentSet(1255362)" /><category term="LTAModel.Incident" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><content type="application/xml"> <m:properties> <d:Message>(6/6)11:06 Roadworks on Somewhere</d:Message> <d:Type>Road Work</d:Type> <d:Summary m:null="true" /> <d:CreateDate m:type="Edm.DateTime">2012-06-06T03:10:10.937</d:CreateDate> <d:Distance m:type="Edm.Double">0</d:Distance> </m:properties></content>\[/code\]And this is how i parse it with sencha.\[code\]Ext.define('xml.store.news', {extend: 'Ext.data.Store',requires: [ 'xml.model.new'],config: { autoLoad: true, model: 'xml.model.new', storeId: 'news', proxy: { type: 'ajax', url: 'users.xml', reader: { type: 'xml', root : 'feed', record: 'entry' } }}});\[/code\]But when i tried to parse the same xml but now its in a url, it won't work.\[code\]config: { autoLoad: true, model: 'xml.model.new', storeId: 'news', proxy: { type: 'ajax', url: 'http://Something', reader: { type: 'xml', root : 'feed', record: 'entry' } }}\[/code\]I went to the url and it ask an authentication for username and password. Is this the reason?If so, how do i do i put the username and password in the code once i received the username and the password?
 
Back
Top