DOM manipulation alternative for Catalog Client Script

Lucy17
Kilo Contributor

After removing iFrame from catalog items and changing all the UI types to "All" on catalog client scripts, there are a bunch of DOM manipulation that is not supported anymore. Is there a similar method to getElementById of an button and change its style and is there a way to manipulate the innerHTML?

6 REPLIES 6

Community Alums
Not applicable

You can re-enable DOM manipulation if you'd prefer.

https://snprotips.com/blog/2017/7/21/how-to-enable-dom-manipulation-in-the-servicenow-service-portal

 

Please mark correct if this solves your issue and helpful 👍 if it has assisted you.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Lucy,

you can use gel instead of getElementById; also ensure Isolate script is set to false on the client scripts to allow DOM script to run

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar I made 'Isolate Script' false and still I am not able to access dom.

Any suggestion please? it enters the method and prints the alert message.

 

find_real_file.png

Should work fine ideally

check if system property "glide.script.block.client.globals" is false if somebody created this property in your scope

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader