locked
WebView InvokeScript RRS feed

  • Question

  • Hi,

    I am building an Windows 8 Metro Style App  (XAML) with a WebView [name: webMain] component. I navigate through pages in it. I have a button, with onclick set to

    this.webMain.InvokeScript("eval", new String[] {"history.go(-1)"}); 

    The problem is that it occasionally throws System.Excetption.

    $exception {"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"}

    Please help.

    Friday, May 18, 2012 2:59 PM

Answers

  • Hi, sorry, it seems that the function called by InvokeScript didn't exists at the time, because of caching issues. Now it works. Also, i thought that if the funtion doesn't exists, it will throw a Javascript exception inside the webview. No exceptions mentioned in docs. 

    Anyway, thank you. I'll post again in case of any problems.

    Monday, May 21, 2012 9:34 AM

All replies

  • Do you have a reproduction application that I can test?  If so, please forward to MSMALL at Microsoft

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Friday, May 18, 2012 5:41 PM
    Moderator
  • Hi, sorry, it seems that the function called by InvokeScript didn't exists at the time, because of caching issues. Now it works. Also, i thought that if the funtion doesn't exists, it will throw a Javascript exception inside the webview. No exceptions mentioned in docs. 

    Anyway, thank you. I'll post again in case of any problems.

    Monday, May 21, 2012 9:34 AM