Layout von Websiten mit Bootstrap und Foundation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # jQuery
  2. > jQuery is a fast, small, and feature-rich JavaScript library.
  3. For information on how to get started and how to use jQuery, please see [jQuery's documentation](https://api.jquery.com/).
  4. For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).
  5. If upgrading, please see the [blog post for 3.5.1](https://blog.jquery.com/2020/05/04/jquery-3-5-1-released-fixing-a-regression/). This includes notable differences from the previous version and a more readable changelog.
  6. ## Including jQuery
  7. Below are some of the most common ways to include jQuery.
  8. ### Browser
  9. #### Script tag
  10. ```html
  11. <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  12. ```
  13. #### Babel
  14. [Babel](https://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.
  15. ```js
  16. import $ from "jquery";
  17. ```
  18. #### Browserify/Webpack
  19. There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documentation. In the script, including jQuery will usually look like this...
  20. ```js
  21. var $ = require( "jquery" );
  22. ```
  23. #### AMD (Asynchronous Module Definition)
  24. AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](https://requirejs.org/docs/whyamd.html).
  25. ```js
  26. define( [ "jquery" ], function( $ ) {
  27. } );
  28. ```
  29. ### Node
  30. To include jQuery in [Node](https://nodejs.org/), first install with npm.
  31. ```sh
  32. npm install jquery
  33. ```
  34. For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/jsdom/jsdom). This can be useful for testing purposes.
  35. ```js
  36. const { JSDOM } = require( "jsdom" );
  37. const { window } = new JSDOM( "" );
  38. const $ = require( "jquery" )( window );
  39. ```