Welcome Guest Search | Active Topics | Sign In | Register

i need get element Options
thành
Posted: Friday, August 12, 2022 10:57:16 PM
Rank: Newbie
Groups: Member

Joined: 8/12/2022
Posts: 3
This is my code: var script = @"
var td_elements = document.getElementsByTagName('div');
var a_elements =[];
if(td_elements != null)
{
for (int i=0; i< td_elements.length; i++)
{
if(td_element[i].getAttribute('className') == 'dgdan')
{
if(td_element[i].Document.getElementsByTagName('p') != null)
{
var p = td_element[i].Document.getElementsByTagName('p');
}
for(int y = 0; y < p.length; y++)
{
var b = p[i].getElementsByTagName('b');
if(b.innerText != null && b.innerText.Contains('đầu tư'))
{
return b.innerText;
}
}
}
}
}
";

JSObject links = (JSObject)webview.EvalScript(script);// this error
eo_support
Posted: Saturday, August 13, 2022 10:40:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
What error do you get?
thành
Posted: Sunday, August 14, 2022 9:10:28 PM
Rank: Newbie
Groups: Member

Joined: 8/12/2022
Posts: 3
EO.WebBrowser.JSException: ', line 6, col 41 - 42: Uncaught SyntaxError: Unexpected identifier
eo_support
Posted: Monday, August 15, 2022 10:36:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This is an error in your JavaScript code. We are not in a position to troubleshoot your code. You will need to resolve such issues yourself.

Thanks!
thành
Posted: Thursday, August 18, 2022 8:33:34 PM
Rank: Newbie
Groups: Member

Joined: 8/12/2022
Posts: 3
Can you give me an example of get elementbytagname, byclass?
eo_support
Posted: Thursday, August 18, 2022 9:56:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
thành wrote:
Can you give me an example of get elementbytagname, byclass?


We do not provide support for general JavaScript programming. You need to seek other channels for such questions.


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.