I have a webview in an iOS App. I have a select box with some values and some javascript code to be executed when the combo changes.
In the browser the same html works ok, but in webview my window.location = url sentence is not working.
How can I do redirect to an url through javascript?
Thanks
Try this:
EDIT:
Try to test your code in mobile Safari on your iOS device (e.g. make the page accessible via your Wi-Fi network) and see what’s happening. If it doesn’t work as well, you’ll probably need to check if your redirection executes at all and if your jQuery code does not stop redirection.
EDIT2:
Do you conform to UIWebViewDelegate protocol and implement its
webView:shouldStartLoadWithRequest:navigationType:method? If not, implement it and return YES if the web view should begin handling your request (you can filter request you want to handle etc.) – more about UIWebViewDelegate you’ll find in docs here.