This topic contains 3 replies, has 0 voices, and was last updated by matthewjiang 7 years, 10 months ago.

  • Author
    Posts
  • #5647

    matthewjiang

    How Can I use JQuery in Suitelet Page? Can someone give steps to do that. Greatly appreciated.
    This is a cached copy. Click here to see the original post.

  • #5648

    erictgrubaugh

    No file loading is necessary for this. jQuery is available by default in all Client Scripts. It gets loaded onto every page in the global scope, and you can access it via the `jQuery` reference instead of the typical `$`. For a Suitelet page, you’ll just need to attach a Client Script to your Suitelet using `nlobjForm.setScript` in 1.0 or `Form.setClientScriptModulePath` in 2.0. Then, in your Client Script, you should be able to write any typical jQuery code you wish using the `jQuery` reference.

  • #5649

    david.smith

    Assuming you’re doing a NS form object (which keeps the NS menu and stuff) then follow what Eric said. Otherwise you will be generating an HTML output like any other HTML page. You just need to set a script tag to load jQuery. This can point to a external CDN or if you want you can put the jquery.js file in NS and load it from the file URL.


    erictgrubaugh replied on 12/30/2016, 12:46 PM: Yes, excellent addition there; I wasn’t thinking of fully custom HTML Suitelets

  • #5650

    matthewjiang

    Great. Thanks.

You must be logged in to reply to this topic.