what is alternative for gel() in client scripts?

ruhee
Tera Contributor

Hi everyone,

I need to find alternative of gel() function used in a client script. This is currently being used to call a Javaserver page(i.e., xyz.do) in servicenow.

var form_name = 'xyz.do';
var form = gel(form_name);

Please let me know if anyone knows alternative of gel(), any help will be grateful.

Thanks in advance! 

 

4 REPLIES 4

Not applicable

Hi Ruhee,

'gel' is simply a shortcut for 'document.getElementById', which is standard javascript. You would use it in client scripts mostly. Search the web for more info. Refer the following link

https://www.w3schools.com/jsref/met_document_getelementbyid.asp

 

Mark if correct/helpful

Thanks

Ajay

find_real_file.png

www.dxsherpa.com

ruhee
Tera Contributor

Hi Ajay,

Thanks for your reply. The use of gel() is fine but I am finding an alternative of it. Can we use other glide form functions instead of it. I tried but it didn't work. So, asking for help if anyone has solution for it. 

Not applicable

Hi Ruhee,

ServiceNow doesn't have any function to handle html elements such as DOM manipulation.

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

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