CDN的引用index.legacy.js 使用示例
时间: 2023-05-27 21:03:20 浏览: 179
unpkg_Node.js_nodejscdn_javascript_CDN_
以下是使用CDN引用index.legacy.js的示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.13.1/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.13.1/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.7.4/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/mobilenet@2.0.1/dist/mobilenet.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd@2.0.1/dist/coco-ssd.min.js"></script>
<script src="index.legacy.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
```
在这个示例中,我们使用CDN引用了多个JavaScript库,包括jQuery、axios、React、ReactDOM、lodash、TensorFlow.js和TensorFlow模型库。然后,我们通过引用index.legacy.js来加载我们的应用程序。最后,在body标签内,我们创建了一个id为“root”的div,用于在应用程序中渲染组件。
阅读全文