Alert into WebView ?

Discussion in 'iOS Programming' started by bboyjayz, May 23, 2009.

  1. bboyjayz macrumors member

    Joined:
    Mar 20, 2009
    #1
    hi,
    i would like to know if it's possible to block alert generated by javascript into a webview ? Thank you for your answers.
     
  2. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #2
    Nope :(
     
  3. TheZimm macrumors 6502a

    TheZimm

    Joined:
    Jul 12, 2008
    #3
    I may be out of my mind for saying this, but you could download whatever the page's code is (html, css, java etc. files) and then parse them to see if threre's an alert in it, delete the alert in the document if its there, and then have the UIWebView reread the edited document, I don't think this would be efficient though, I think it would take an awful long time just to load one web page.

    Dan
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    I'd like to hear more about why you feel the need to block a javascript alert, bboyjayz.
     
  5. bboyjayz thread starter macrumors member

    Joined:
    Mar 20, 2009
    #5
    that's 'cause i had an idea for an app... and alert can't be accepted because it can freez the game.. :(
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    So you have an app, that's a game, that runs in a webView?
     
  7. bboyjayz thread starter macrumors member

    Joined:
    Mar 20, 2009
    #7
    Yes, it's a kind of quiz, using webview ... it's hard to understand :) but if i meet a webpage with Alert() javascript, it'll freez my app .. :s
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    So, you don't have control of the webpages that are being displayed in your app? Besides, once the user clicks the OK on the alert, the app continues, yes?
     

Share This Page