How do I make a GlideAjax call from a processor? or call Script Include without GlideAjax

nathanfirth
Tera Guru

So here is what we are trying to do, we have built a new application that uses a processor because of js_includes conflicts when using UI pages. The app works great and it's nice because it doesn't come with all the includes and additional markup thats get jammed into a UI page.

 

So now, since js_includes and prototype is not available on the page... how do I make a GlideAjax call? Or can I mimic a GlideAjax call using jQuery Ajax?

 

I can already use the JSONv2 API to access all data client side, but being able to call Script Includes would be great.

 

Any thoughts or suggestions would be greatly appreciated.

1 ACCEPTED SOLUTION

kin-corn-karn
Giga Contributor

You can use jQuery.ajax, but you'll need the g_ck token to go along with it.   Here's an quick example of how I run mine:



jQuery.ajax({


  url: 'xmlhttp.do',


  data: {


      sysparm_processor: 'ScriptIncludeName',


      sysparm_name: 'MethodName',


      sys_id: 'ParameterValue',


      table: 'ParameterValue'


  },


  headers: {


      'X-UserToken': g_ck


  },


  success: function(response) {


      console.log('received ' + response)


  }


});


View solution in original post

5 REPLIES 5

They aren't required -- those are just a couple of parameters I'm reading in the ScriptIncludeName.MethodName method in my script include.