Results 1 to 3 of 3

Thread: XML Parsing Producing error while the app is turned to a native app.

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

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    What other than ST2 are you using? Are you loading from a different domain?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User roymj88's Avatar
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Vote Rating
    0
      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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •