jQuery & jQuery UI in custom file with .sortable (v2022)

I placed these code in the being of custom file (I try to put in the latest version of jquery & jquery-ui)

    <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
    <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>

or (another version)

    <script src="https://code.jquery.com/jquery-3.2.0.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>

When loading this page, it shown ew.js error “amd” in (F12) console.logMy php version is 8.1.21If I create a simple .php file (no phpmaker involved)
it works as expected.Hope to get some hints how to solve this issue.Thanks in advance.
scs

  1. You should not add jQuery again because it is already included in the template.
  2. To use your own jquery-ui.min.js (with sortable) you should replace the one in the template (under “jquery” subfolder).

Thanks.

  1. in this case, I remove the jquery script from my code.
    delete output folder, regen entire project & Run it…
    Now, it shown, jquery not defined.
    In the template folder, there are files named jquery.min (88k) and jquery-3.4.1.min (87k) as as well.
  2. I checked the template folder, is the file jquery.ui.widget & jquery.ui.widget.min, it it the same as jquery-ui?

Regards,
scs

  1. You need to use loadjs.ready(“jquery”, …), read Page_Head, you need to wait until jQuery is loaded before you can use it,
  2. There should be no jquery.ui.widget.min.js in the template, but there is jquery-ui.js which is a minimal version of jQuery UI, if you open the file you see: Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js, widgets/mouse.js. That’s why:


To use your own jquery-ui.min.js (with sortable) you should replace the one in the template (under “jquery” subfolder).