javascript - “index.js?v=xxx”是干什么用的?
问题描述
jupyter notebook在加载的时候会导入一堆javascript文件,几乎都是URL模式.js?v=xxx
我了解一些带参数的 URL 可用于 http get 方法。
https://www.google.com/search?q=javascript
jupyter notebook 中的“index.js?v=xxx”是什么?
这是部分内容/static/components/proptypes/index.js
,点击这里查看完整版
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define('PropTypes', ['exports', 'module'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module);
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod);
global.PropTypes = mod.exports;
}
})
我比较了
http://localhost:8888/static/components/proptypes/index.js?v=c40890eb04df9811fcc4d47e53a29604
和
http://localhost:8888/static/components/proptypes/index.js
它们没有任何区别。
是function (global, factory)
处理参数v
吗?
https://code.jquery.com/jquery.js?v=c40890eb04df9811fcc4d47e53a29604
并且https://code.jquery.com/jquery.js
是相同的文件,而https://code.jquery.com/jquery-1.12.4.js
较新。
解决方案
这取决于您如何编写应用程序。我使用版本来强制下载更新的 javascript。否则浏览器将尝试使用现有的缓存并且应用程序将拒绝相应地工作。
推荐阅读
- python - 我的不和谐机器人刚刚坏了,我不知道为什么(discord.py)
- android - 适用于 Android 的 IntelliJ IDEA 上的 Gradle 同步错误
- c# - 如何使用参数 ASP.NET MVC 调用 Ajax 数据表?
- node.js - 如何将 jwt 从 swift 客户端传递到 node.js 服务器
- unix - AWK 在 shell 内打印意外的换行符或字符串结尾
- flutter - 提供者对象在现有构建期间请求重建
- typescript - 如何在 Typescript 类中使用 yield
- python - 通过 python 子进程运行多线程 C 程序
- css - 我试图创建一个页脚保持底部,但它不工作
- javascript - 使用 Webpack 4 获取捆绑的两个脚本标签