- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 01:18 AM
Hi,
GlideAjax call to server side.
When we use client script to call server script then we use
line 1 ga.getXML(callBackFunction);
line 2 function callBackFunction(response) {
line 3 var answer = response.resonseXML.documentElement.getAttribute(answer);
I have used it many times.
Can anyone please make me understand line 1, line 2, line 3, why we use this line everytime in client script.
Regards,
Nivedita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 02:20 AM
Hi @niveditakumari ,
I could write the answer for this, but I am happier to share a link which will answer your query as well as give you a deep view of all which you're using.
I hope this might help you a lot to understand the perspective of every function well.
GlideRecord & GlideAjax: Client-Side Vs. Server-Side - ServiceNow Developer Pro-Tips (snprotips.com)
This article has line by line explanation of the code you have!
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 02:20 AM
Hi @niveditakumari ,
I could write the answer for this, but I am happier to share a link which will answer your query as well as give you a deep view of all which you're using.
I hope this might help you a lot to understand the perspective of every function well.
GlideRecord & GlideAjax: Client-Side Vs. Server-Side - ServiceNow Developer Pro-Tips (snprotips.com)
This article has line by line explanation of the code you have!
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 01:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 03:54 PM
What @Rahul Talreja says, but also because people have not heard of getXMLAnswer in which case your step 3 is not needed, because GlideAjax executes that internally and passes in answer to callBackFunction:
line 1 ga.getXMLAnswer(callBackFunction);
line 2 function callBackFunction(answer) {