Inject JS issue

I am getting error while using inject js as:
Inject js : Exception from HRESULT: 0x80020101.
How to solve this?

Can you check if your script working correctly?

That Error generally occurs when you have a syntax error in the Javascript,

Please try with this attached sample workflow and let me know :slight_smile:

InjectSampleJs.zip (2.7 KB)

Regards…!!
Aksh

2 Likes

You may playaround with your script here

jsFiddle Demo

1 Like

I am getting this error:
Inject js : Cannot find the UI element corresponding to this selector:
"webctrl id=‘mainContent’ tag=‘main’ "

Nothing this is selector error. just clear the invoke js Activity “Selector” property and try it ant let me know :slight_smile:

Regards…!!
Aksh

I have cleared selector but again i got same error Inject js : Exception from HRESULT: 0x80020101

Will you share the screensot of that error?

attachment not allowed

thanks @aksh1yadav , its working now.

Hi,

I have an issue with Inject JS myself.
I dragged the activity inside an Open Browser and added “alert(‘test’)” in the ScriptCode field. The error thrown is “TypeError: Object expected”.
I tried indicating a random element in the page and also leaving the Selector field empty - none worked.

Can anyone advise how to inject javascript code directly without using a js file?

Hey @theo500

Try This: Jssample.xaml (5.8 KB)

Regards…!!
Aksh

1 Like

Hi @aksh1yadav ,

It seems to be working in Chrome but not IE. Will investigate the security settings.

Thanks a lot!

Hi,
I have tried with your example…It is working fine with chrome browser but not with IE. Is there any setting that need to be changed in IE…?

Regards,
Saamir

CHrome browser some selectors will very so :slight_smile:

Hi guys, did you handle the issue related to JS in IE? Testing “hello world” example works for me in chrome, but not in IE, is this issue related to some Security staff? Any idea? Thanks, Frantisek.

Hey,i have some difficulties with this sample,The alert can’t be work .

.
Here is xaml file:
Jssample.xaml (6.0 KB)
(ps,i made some change of web’s info.)
Regards