Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2010
    Location
    Wisconsin
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Mobile Development Question (Jquery, ajax, html5 related)

    What would be the best way to get data for a mobile site. I've tried using Jquery $.ajax to bring in the data from a php file.

    It seems to work however it takes some time to load without a way to really give a progress meter. I was wondering what the fastest way to do this would be. For instance it loads and loads then after a long while the alert(); pops up and the data loads into the page.

    Ultimately i was thinking i could use the ajax request to read in the data from the mysql database server, then transfer it to localstorage, im using HTML5 primarily for the development also just for reference.

    Somewhat new to mobile development i was just wondering if anyone had a starting point for me to look at and go from there.

    Code:
    $(document).ready(function($){
    	var dataret = 0;
    	
    		$.ajax({
    		  type: 'POST',
    		  url: 'mobile.php',
    		  beforeSend: function(){
    		  	$('#status').show();
    		  },
    		  success: function(data){
    		  //initialize localstorage here
    		  	alert('success');
    		  	
    // if it takes as long as it does, a few minutes, at least show a loading bar...
    		  	$('#progress').progressbar({
    		  		
    		  	});
    		  
    		  },
    		  dataType: 'json'
    		});
    	
    	});
    Thanks in advance!
    Last edited by Rebelj12a; 08-04-2010 at 03:04 AM.

  • #2
    New Coder
    Join Date
    Jan 2010
    Location
    Wisconsin
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Ok so nevermind!

    There should seriously be just a forum area or whatnot to post where nobody sees, because as soon as i post, i almost always go to the next step immediately and somehow figure it out... As if the universe wants me to make a fool of myself... the above method works thanks


  •  

    Tags for this Thread

    Posting Permissions

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