This topic contains 6 replies, has 0 voices, and was last updated by CREECE 7 years, 7 months ago.
-
AuthorPosts
-
March 21, 2017 at 6:48 am #1028
jmacdonaldHey 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. -
March 21, 2017 at 8:26 am #1029
david.smithIt’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.
-
March 21, 2017 at 8:40 am #1030
jmacdonalddavid.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();
-
March 21, 2017 at 9:09 am #1031
david.smithYes. I believe so.
-
March 21, 2017 at 10:23 pm #1032
michoelOriginally 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.
-
March 26, 2017 at 6:25 pm #1033
chanarbonOriginally 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
-
March 26, 2017 at 10:46 pm #1034
CREECEBeyond 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.
-
AuthorPosts
You must be logged in to reply to this topic.