views:

269

answers:

2

I've got an iPhone web-app which I'd like to look as native as possible. I've used the scrolling trick to get rid of Safari's navigation, and taken away scrolling to prevent it from coming back; however, every time my app pulls an XHR, it shows the navigation again. Because users will need to use external links to get into the app, I cannot use a standalone bookmark. Is there any way to do the AJAX calls on the sneak?


Edit: I found that it was actually the fact that I'm using the hash method for AJAX history. It makes sense that the nav slides out temporarily, since I'm updating the URL. Thanks for your responses.

A: 

Yes, would be the short answer.

Since my webapps don't show the navigation bar, I have to assume that you are doing something other than just the XHR call which causes the scroll. Share some code and maybe we can see it.

For example, Night Sky and Border Gas both do XHR calls.

GeoNomad
A: 

Yes. I've tried two methods: one using plain XHR and one using jQuery.

XHR example you can see here: AnyExample.com

and here's the shorter jQuery version:

window.scrollTo(0, 1); 
$.get("http://www.stackoverflow.com");

Same as GeoNomad, the navbar didn't come to view, and all I saw was the loading icon on the top bar.

Nir