1

I would like to update jquery-ui.js in my ASP.NET Core MVC application. I saw that the file is located in the following structure:

enter image description here

What is the correct way to do this?

Should I just download the file from https://jqueryui.com/ and replace it with the same file that is currently in the jquery-ui folder? Currently, the jquery-ui file in this folder has the following version:

/*! jQuery UI - v1.12.1 - 2018-06-18

and I would like to update it to the latest version.

Thank you in advance,

Best regards

3
  • Check your project/solution nuget packages. If it's in there, easiest method is to update the package. Commented May 23, 2024 at 10:31
  • If you're manually updating jquery-ui then make sure you update all the files, not just the js (specifically, also include the .css, but there may be other files to update). Commented May 23, 2024 at 10:32
  • @fdomn-m I am not sure, I have only this file in this path that I mentioned above wwwroot/scripts/vendor/jquery-ui/jquery-ui.js ... I am not sure about other files, like css etc ? Commented May 23, 2024 at 12:02

1 Answer 1

0

Should I just download the file from https://jqueryui.com/ and replace it with the same file that is currently in the jquery-ui folder?

Yes, it is also a quick way to update the client-side libraries. Another way, you can use Libman in visual studio to update the client side library version.

For both of the two ways you can choose to update the client-site libraries.

For which way to choose, you need consider:

If you download the jQuery ui by official website before, using libman contains a disadvantage that you may need update references in views. Because the folder download by the two ways may different.e.g. The jquery-ui.css contains in the root folder if downloading by website, but it contains in rootfolder\themes\base\jquery-ui.css if downloading by libman.


For how to use Libman, detailed steps you could follow

  • If your project already uses LibMan, you will find a libman.json file in the root of your project. Open this file.
  • If your project does not have a libman.json file, you can add one by right-clicking on the project in Solution Explorer, then selecting Manage Client-Side Libraries.

Configure libman.json:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "[email protected]", // specify the latest version here
      "destination": "wwwroot/lib/jquery-ui-1.13.2/", //the location of the jquery ui
      "files": [
        "jquery-ui.min.js", //the file you want to update
        "jquery-ui.js"
      ]
    }
  ]
}

The libman.json contains the intelliSense when writing the files you want to update, so you don't worry about making mistake. enter image description here

But if you need update multiple or whole referenced files and do not want to manually wirte the json.

You can firstly delete all the file in your current jquery-ui root folder and maintain the root folder of jquery-ui(jquery-ui-1.13.2 here in my project).

Then right-click on the project in Solution Explorer, select Add > Client-Side Library. Choose the package and location you want like below. enter image description here

At last click the Install button, it will download all the referenced file in this folder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.