1. #1
    Sencha User roymj88's Avatar
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Vote Rating
    0
    roymj88 is on a distinguished road

      0  

    Default 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

    Code:
    url: "http://www.sicsglobal.com/projects/classapp/class-app-xml/login.xml",
    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.

    Thanks

    Roy M J

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What other than ST2 are you using? Are you loading from a different domain?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User roymj88's Avatar
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Vote Rating
    0
    roymj88 is on a distinguished road

      0  

    Default


    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

Thread Participants: 1