Gs object not working in client script

naziya
Giga Contributor

I am trying to use GS object in my client script but I am getting the error :-

'The object "gs" should not be used in client scripts'

How can I use gs in my script?

12 REPLIES 12

gs is documented here:


GlideSystem - ServiceNow Wiki


loudari_karim
Kilo Explorer

The GlideAjax class allows the execution of server-side code from the client. GlideAjax calls pass parameters to the script includes, and, using naming conventions, allows the use of these parameters.




See GlideAjax - ServiceNow Wiki  


var HelloWorld = Class.create();


HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, {


  helloWorld: function() {


    return gs.example();


    }


});