This topic contains 6 replies, has 0 voices, and was last updated by CREECE 7 years, 7 months ago.

  • Author
    Posts
  • #1028

    jmacdonald

    Hey all, I have a question about adding jQuery to scripts. Now that NetSuite is going to stop providing jQuery I am looking into adding it manually, does anyone know what will happen in the following situation:

    We have 2 bundles, one bundle has an older implementation of jQuery running on Sales Orders. The second bundle has a newer implementation of jQuery with additional features not present in the version included in the first bundle, also running on Sales Orders. (edited)

    If they both are running at the same time, will each script use it’s own implementation of jQuery? I’m worried that in this situation only one version of jQuery will be loaded and if the first one is loaded without the additional features then it will cause errors.

    We have a large amount of customer sites so we are trying to avoid having to manually go on each and add a /SuiteScripts/Libraries folder with jQuery in it. Anyone have any experience or insight with this?
    This is a cached copy. Click here to see the original post.

  • #1029

    david.smith

    It’s just the jQueryUI library that is no longer loaded on NetSuite pages.

    But to somewhat answer your question you should use the no conflict in your bundles.

  • #1030

    jmacdonald

    david.smith I did not realise it was only the UI library being removed. Does that mean that I can still use jQuery in scripts? e.g. jQuery(‘#custpage_addon_sublist_buttons’).hide();

  • #1031

    david.smith

    Yes. I believe so.

  • #1032

    michoel

    Originally posted by jmacdonald

    View Post

    david.smith I did not realise it was only the UI library being removed. Does that mean that I can still use jQuery in scripts?

    You can (and I do), but just like the case with jQuery UI, it’s only there because Netsuite was using it internally, and so there are no guarantees that it won’t be removed or the version changed at any point in the future.

  • #1033

    chanarbon

    Originally posted by michoel

    View Post

    You can (and I do), but just like the case with jQuery UI, it’s only there because Netsuite was using it internally, and so there are no guarantees that it won’t be removed or the version changed at any point in the future.

    Agreeing, as for this concern, please note that we would recommend using the APIs instead of performing DOM. Also, to cater the needs addressed by DOM activity, please let use know through a case so that we could have an enhancement filed for the concern and we could provide future APIs for the need

  • #1034

    CREECE

    Beyond the native netsuite page DOM, a lot of custom suitelets use JQuery and JQuery UI. It is really best to add your own libraries and not rely on anything NetSuite provides as they can yank it or update it at any moment (and do) which can cause issues.

You must be logged in to reply to this topic.