jQuery项目中使用mock.js
作者:互联网
1.新建文件夹jquery-mock-demo
2.在文件夹jquery-mock-demo下新建index.html,引入jquery.js和mock.js,index.html代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Document</title>
<script>src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"</script>
<script>src="https://cdn.bootcss.com/Mock.js/1.0.0/mock-min.js"</script>
</head>
<body>
</body>
</html>
3.在文件夹jquery-mock-demo下新建mock文件夹
4.在mock文件夹下新建index.js,index.js代码:
标签:jQuery,jquery,index,demo,js,文件夹,mock 来源: https://www.cnblogs.com/jingzaixin/p/16460081.html