简体   繁体   中英

trying to install jquery-ui without nuget

Yesterday I asked a question about setting the date of calendar in jquery. I found out my code was correct however I was missing the two references below.

https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.6.5/datepicker.css
https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css

I already am able to use the reference below in my web page.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

So I read I should install jQuery UI via nuget in Visual Studio. Here is where my problem began. Basically my company like to make things hard so whilst nuget is installed we are prevented from using it.

So I am trying to install jquery ui without Nuget but without success. I went to this page on jquery.com about downloaded the zip file. However I can't install it or use it?

Also I need the datepicker file which seems seperate to jquery-ui?

Update

So apologies, I know I am being quite dumb here but just trying to understand.

1) So in my project I created a CSS folder where I saved my own css file. And reference it like below.

<link href="CSS/myCSS.css" rel="stylesheet" type="text/css"/>

So with the files I downloaded from jquery I take it I can copy jquery-ui.css and jquery-ui.min.css into this folder and reference them in the same way,

<link href="CSS/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link href="CSS/jquery-ui.min.css" rel="stylesheet" type="text/css"/>

2) Also in my project there is a folder called scripts. I have my own javascript file called myJS. I reference it like below,

<script src="scripts/myJS.js"></script> 

So from my download from jquery if I copy over jquery-ui.js and jquery-ui.min.js and the external directory and put them in my scripts folder I can reference the files as such,

<script src="scripts/external/jquery/jquery.js"></script>
<script src="scripts/jquery-ui.min.js"></script>
<script src="scripts/jquery-ui.js"></script>

And then remove this line as it will now not be needed.

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

Is that correct or am I still missing something?

simple you can download jquery-ui package and than put files from package to your project. download link : https://jqueryui.com/download/

after that you can import that files to your project like this :

<link rel="stylesheet" href="jquery-ui.min.css">
<script src="external/jquery/jquery.js"></script>
<script src="jquery-ui.min.js"></script>

actually nuget don't "installs" it in your project, it simply downloads it and than imports.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM