...

View Full Version : Mobile Development Question (Jquery, ajax, html5 related)



Rebelj12a
08-04-2010, 02:45 AM
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.



$(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!

Rebelj12a
08-04-2010, 03:07 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum