博文

目前显示的是标签为“Js”的博文

How to npm install jquery-ui and import it as a ESM?

We can use jquery-ui-bundle: npm install jquery-ui-bundle --save Then import: import 'jquery-ui-bundle'; import 'jquery-ui-bundle/jquery-ui.css';

Trap on the way to use a browserified react script - Invariant Violation: Target container is not a DOM element.

When using a script browserified from a react project, I encountered an error said: Invariant Violation: Target container is not a DOM element. It confused me for a while. After I moved the HTML script label from head to the end of the body , the problem was solved. It seems that when the script was executed, the related dom element had not been loaded yet. Then I tried ready function from jQuery, it also works. So when get this kind of error, try to check the position of the script.

Special effects for html using JS and CSS

This page may not work because the restriction of the Blog theme. Please use your browser to inspect the code. Thank you! Magic Letterfall Mad Rotating Letters Mad Scaling Letters

Symbols in the version field of package.json

You may have seen something like the following code before in package.json and may be puzzled about the symbols like '<>~^'. Code: { "dependencies" : { "foo" : "1.0.0 - 2.9999.9999" , "bar" : ">=1.0.2 <2.1.2" , "baz" : ">1.0.2 <=2.3.4" , "boo" : "2.0.1" , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0" , "asd" : "http://asdf.com/asdf.tar.gz" , "til" : "~1.2" , "elf" : "~1.2.3" , "two" : "2.x" , "thr" : "3.3.x" , "lat" : "latest" , "dyl" : "file:../dyl" } } Here are the definitions I found in https://docs.npmjs.com/files/package.json . version  Must match  version  exactly >version  Must be greater than  version >=version  etc <version <=versi...