Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Back/Forward buttons for UIWebView - canGoBack not working with ajax sites

I'm using some toolbar buttons for going back and forwards through historic webpages in a UIWebview. enter image description here

I am enabling/disabling these buttons using [webview canGoBack] called at webViewDidStartLoad. Works fine on most sites, but the problem is, on sites like twitter and facebook who use javascript/ajax requests to reload new pages canGoBack and canGoForward do not recognise a page change so my buttons don't become active.

Is there a way round this?

like image 593
Liam Avatar asked Nov 03 '22 17:11

Liam


1 Answers

In my experience, the site itself has to support back/forward on top of their AJAX requests. It would require the web application to change the URL for each page navigation.

See http://www.devx.com/webdev/Article/35549 for some discussion on this issue.

So, specific to your question - if it's your own web app, it's definitely possible (there are several javascript solutions, one of which is linked above), but for 3rd party web apps, I'd say no.

like image 138
Krease Avatar answered Nov 09 '22 03:11

Krease