How To Use Jquery In TypeScript
If you have Typescript installed you can skip to Jquery section directly.
Install TypeScript
Installing Typescript with snowpack is very easy. Before that make sure you have NPM installed.
In your project folder, execute following command...
npx create-snowpack-app . --template @snowpack/app-template-blank-typescript --force
To test if typescript is installed, run following command...
npm start
You should see your browser window with default html page opened.
Install Jquery in TypeScript
npm i jquery
npm i --save-dev @types/jquery
Now let us test if Jquery is working.
In your index.js, type following code, import jquery like this...
import $ from "jquery"
After you save, If you didn't see any error. It means jquery is working fine.
Related Notebooks
- How To Use Grep In R
- How To Use Python Pip
- How To Use Pandas Correlation Matrix
- How To Use R Dplyr Package
- How To Use Selenium Webdriver To Crawl Websites
- Why do we use Optional ListNode in Python
- How To Write DataFrame To CSV In R
- How To Handle nan In Numpy
- How To Plot Histogram In R
- How To Iterate Over Rows In A Dataframe In Pandas