Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Can't run webview script? Options
Yen.Dang
Posted: Thursday, September 9, 2021 4:00:38 PM
Rank: Newbie
Groups: Member

Joined: 9/8/2021
Posts: 8
Hi admin,
I am following some of your code samples but my code always returns an error.
The equivalent code runs fine in the DOM, here's the code I've adapted to.

Quote:
Dim jsCode As String = "(function ()
{
var elements = document.getElementsByTagName('" & tagname & "');
for (var i = 0; i < elements.length; i++) {
if(elements[i].className =""" & s(1) & """){
elements[i].click();
return;
}
}‚Äč
})();"
webView.EvalScript(jsCode)


An exception of type 'EO.WebBrowser.JSException' occurred in EO.Base.dll but was not handled in user code
, line 9, col 49 - 49: Uncaught SyntaxError: Invalid or unexpected token
If there is a handler for this exception, the program may be safely continued.


Am I missing something?
Jack Cheng
Posted: Thursday, September 9, 2021 4:32:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
Hi,

This means there is something wrong with the script code you are trying to run. You can copy and paste the JavaScript into Chrome's debug console to debug it.

Thanks!
Yen.Dang
Posted: Thursday, September 9, 2021 5:27:58 PM
Rank: Newbie
Groups: Member

Joined: 9/8/2021
Posts: 8
Hi,
Thank you.
This is difficult. it seems too sophisticated to me.
I will try some other solutions.
Jack Cheng
Posted: Friday, September 10, 2021 9:56:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
You do need to be familiar with web page basics and JavaScript in order to use our product effectively. We wish you best luck with other solutions.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.