Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
javascript access in xamWebHtmlViewer
posted

I am hosting a web user control inside the xamWebHtmlViewer and need access to javascript methods that are in page that is run inside the xamWebHtmlViewer.  Any ideas on how to access the page hosted within the HtmlViewer?

 

thanks in advance

Parents
No Data
Reply
  • 760
    posted

    Hello jmahoney,

    The xamWebHtmlViewer doesn't have a public property referencing the loaded web page. It internally uses an IFRAME html element. So if you want to access the page's  java script from your Silverlight application, you have to access the main page DOM. Then find the IFRAME element and access the page, and finally you'll have to get the javascript from the page.

    It's a bit tricky but it's not impossible. Bear in mind that if you have more than one HtmlViewer it'll probably be difficult to distinguish the two IFRAMEs.

    Regards,

    Doychin Dochev

Children