what is alternative for gel() in client scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 12:31 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 12:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 12:51 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 12:55 AM
Hi Ruhee,
Refer the following communinty thread :
Thanks
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 02:59 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader