How to add Jquery Datatable into Servicenow to create UI page

randeepnath
Mega Contributor

Please help me to include Jquery Datatable - //cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js -

How we can create a UI page using the above Jquery script -

Please give me the exact steps to include this in a scoped application.

Thanks in advance !!

7 REPLIES 7

I don't have much experience in apps and their scope. But adding the script in its scope would be better if it is not going to be used by other apps.


randeepnath
Mega Contributor

But while adding this jquery library in UI script -   I am getting the following code in the Script text box -




var x_37731_testapp_int = x_37731_litmos_int || {};


x_37731_testapp_int.test = (function() {


  "use strict";


/* set your private variables and functions here. For example:


  var privateVar = 0;


  function private_function() {


  return ++privateVar;


  }


*/


/* Share variables between multiple UI scripts by adding them to your scope object. For example:


  x_37731_testapp_int .sharedVar = 0;



Then access them in your scripts the same way. For example:


  function get_shared() {


  return x_37731_testapp_int .sharedVar;


  }


*/


  return {



/* set your public API here. For example:


  incrementAndReturnPrivateVar: function() {


  return private_function();


  },


*/


  type:   "test"


  };


})();




In this where I have to copy - paste the jquery librabry, as I am getting some errors while doing so -



Any idea ?


Delete everything. Copy-Paste and check.