I am developing a wp application in which there is a webbrowser which loads a web page. I want to add javascript file which fills a text box in loaded web page with some data and click on submit button. I want this javascript file to run automatically once webbrowser tool loads web page completely.
Asked
Active
Viewed 109 times
1 Answers
1
When the web browser completely loads a page, the Navigated
event will fire.
In the event handler, you can execute arbitrary JavaScript code by calling theBrazza.InvokeScript( "eval", SomeJavaScriptSource );
where SomeJavaScriptSource
is a variable or constant containing the JavaScript you’d like to run (just don't forget to specify IsScriptEnabled="True"
in your web browser).
If your page already has any JavaScript code in it - you'll be fine, otherwise this approach wont work: that thread is old, however now in Windows Phone 8 the problem is still present :-(

Soonts
- 20,079
- 9
- 57
- 130
-
can u share me example link for javascript – Nitish Bangad Feb 04 '14 at 08:52
-
`const string SomeJavaScriptSource = @"document.getElementById('username').value=""moo""; document.forms[0].submit();"` – Soonts Feb 04 '14 at 11:04
-
Am unable to do. Am getting error 80020101 ... Any solution? – Nitish Bangad Feb 11 '14 at 16:56