Go Back   CodingForums.com > :: Client side development > General web building > Building for mobile devices

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-04-2010, 01:45 AM   PM User | #1
Rebelj12a
New Coder

 
Join Date: Jan 2010
Location: Wisconsin
Posts: 24
Thanks: 2
Thanked 0 Times in 0 Posts
Rebelj12a is an unknown quantity at this point
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 02:04 AM..
Rebelj12a is offline   Reply With Quote
Old 08-04-2010, 02:07 AM   PM User | #2
Rebelj12a
New Coder

 
Join Date: Jan 2010
Location: Wisconsin
Posts: 24
Thanks: 2
Thanked 0 Times in 0 Posts
Rebelj12a is an unknown quantity at this point
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
Rebelj12a is offline   Reply With Quote
Reply

Bookmarks

Tags
ajax, html5, jquery, mobile, safari

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:37 PM.


Advertisement
Log in to turn off these ads.