window.location.href is not working in Client Script

David Vu1
Kilo Expert

Good day everyone!

Does anyone know why the window.location.href is not working in client script?

It shows the error : 

find_real_file.png

 

Thank you

1 ACCEPTED SOLUTION

Brent Sutton
Mega Sage

Hi David,

The window object is not available when running the client script with "Isolate script" ticked (and not at all in Service Portal). If you are running the client script on the Desktop then you should be able to untick "Isolate script" for that client script. Should work once you do that.

Brent

P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information. 

View solution in original post

3 REPLIES 3

Brent Sutton
Mega Sage

Hi David,

The window object is not available when running the client script with "Isolate script" ticked (and not at all in Service Portal). If you are running the client script on the Desktop then you should be able to untick "Isolate script" for that client script. Should work once you do that.

Brent

P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information. 

David Vu1
Kilo Expert

Perfect!!!!! Thank you 🙂

No worries, glad I could help.