如何通过 javascript 获取引导程序版本? [英] How can I get bootstrap version via javascript?

查看:35
本文介绍了如何通过 javascript 获取引导程序版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过调用函数来获取bootstrap 版本?查了查也没找到,开头的评论里有版本信息,如下:

Is there any way to get bootstrap version via calling a function? I did some research but couldn't find any way, the version information is included in the comments at the beginning like this:

<代码>/*!* Bootstrap v3.3.7 (http://getbootstrap.com)* 版权所有 2011-2016 Twitter, Inc.* 在 MIT 许可下获得许可*/

但如果评论被删除,我如何获得引导程序版本?Bootstrap 插件中定义了一个版本,但我正在寻找通用的引导程序版本,而不是特定插件的版本.

But in case the comments are removed how do I get the bootstrap version? Bootstrap plugins have a version defined in them but I'm looking for the general bootstrap version, not version of a particular plugin.

推荐答案

Bootstrap 的每个 jQuery 插件的版本都可以通过插件构造函数的 VERSION 属性访问.例如,对于工具提示插件:

The version of each of Bootstrap's jQuery plugins can be accessed via the VERSION property of the plugin's constructor. For example, for the tooltip plugin:

$.fn.tooltip.Constructor.VERSION // => "3.3.7"

src//getbootstrap.com/javascript/#js-version-nums

如果你的意思是来自 css,那么你需要 AJAX 文件和 .match(/v[.\d]+[.\d]/);

if you mean from the css, then yu ahve to AJAX the file and .match(/v[.\d]+[.\d]/);

这篇关于如何通过 javascript 获取引导程序版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆