首页 > 解决方案 > “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较新。

标签: javascriptjupyter-notebook

解决方案


这取决于您如何编写应用程序。我使用版本来强制下载更新的 javascript。否则浏览器将尝试使用现有的缓存并且应用程序将拒绝相应地工作。


推荐阅读