https://github.com/wscats/requirejs-demo
《RequreJS学习笔记》
https://github.com/wscats/requirejs-demo
amd commonjs component module requirejs shim
Last synced: 6 months ago
JSON representation
《RequreJS学习笔记》
- Host: GitHub
- URL: https://github.com/wscats/requirejs-demo
- Owner: Wscats
- Created: 2016-08-02T02:36:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T03:09:38.000Z (almost 6 years ago)
- Last Synced: 2024-12-10T08:51:10.123Z (6 months ago)
- Topics: amd, commonjs, component, module, requirejs, shim
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 198
- Watchers: 12
- Forks: 38
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## RequireJS
**require.js加载js文件的好处**
1. 可以防止JS加载时候阻塞页面渲染(JS运行时候DOM停止渲染的情况)
2. 使用require.js调用的方式加载JS,不用在像以前那样多个``标签引入JS文件所有代码的目录结构如图

[代码存放的Github地址](https://github.com/Wscats/requirejs-demo)
## 传统的引入
**start.html**```html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/require.js">
wsscat
wsscat