-
13 Dec 2011 2:50 AM #1
XML Parsing Producing error while the app is turned to a native app.
XML Parsing Producing error while the app is turned to a native app.
Hi,
I am developing a simple application which unfortunately for me needs access to database. While the app works perfectly while running through url, it does not work when used as an iphone app. The problem is the xml parsing is not taking place properly.
Code:function login(){ $.ajax({ type: "GET", url: "http://www.sicsglobal.com/projects/classapp/class-app-xml/login.xml", dataType: "xml", success: parseXml }); function parseXml(xml) { var schoolname = document.getElementById("schoolname").value; var activation = document.getElementById("activation").value; $(xml).find("login").each(function(){ var username = $(this).find("username").text(); var password = $(this).find("password").text(); if((schoolname==username)&&(activation==password)){ Test.Viewport.setActiveItem('second',{type:'slide', direction:'left'}); } else{ document.getElementById('login_response').innerHTML = '<br><span style="color:#FFF">Invalid schoolname/activation code</span>'; } }); } }
The url does not work
Is there any way around this? I just need to compare details from database. Kindly help. All the screens are done and now only thing pending is filling up the screens with data fetched from database through xmls.Code:url: "http://www.sicsglobal.com/projects/classapp/class-app-xml/login.xml",
Thanks
Roy M J
-
13 Dec 2011 7:21 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
What other than ST2 are you using? Are you loading from a different domain?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Dec 2011 8:46 AM #3
Hi,
I am just using Sencha touch 2. I am new to sencha and i am not sure whether i can use any of other products along with this.
The problem with my app is that when i run through browser it works fine.
But when i convert it to a native app(iphone app using xcode build), the app doesnt work. I have searched through code one line after another and then found that the code stops responding in the xml parsing part. And i am assuming when the app is converted to native app to run in a browser, the database connectivity fails.
Is there any way that i can get the database connection when the app is made to a native app.
Thanks
Roy



Reply With Quote