How to handle alert events in UIWebView

Discussion in 'iOS Programming' started by anuhoho, Jun 28, 2011.

  1. anuhoho macrumors newbie

    Joined:
    May 22, 2011
    #1
    Hi

    I have a url which shows a username,password fields and a submit button. On clicking the submit button it pops up a alert view in my device stating some message. I need to capture that message and use it in my application. Now that are java alerts that are being displayed.

    So i need to find out a way so that as soon as the user clicks submit, I can disable the UIWebView and can take out the message from the pop up alert so that i can use it.
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Maybe it's not possible under iOS to do this?

    Under Mac OS X, you'd attached a WebUIDelegate to the WebView. But iOS's UIWebView doesn't have this.
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    I think that the only way would be via javascript. But I have no idea how to do this.

    I know there are articles on the web with info on how to use javascript to get notifications from UIWebview. Look there.
     

Share This Page