Browser-Update.org customization
Browser-Update.org customization
我正在尝试从 Browser-Update.org 项目中实现脚本,该脚本检查浏览器版本并提示用户更新(如果他们使用的是旧版本)。可以在这里找到它。
在他们的自定义文档中,它们允许您在显示信息栏时执行javascript:
onshow: function(infos){}, // callback function after the bar has appeared
我不知道在他们的脚本中插入它的哪个位置。我想在触发 onshow 时运行以下 javascript:
document.getElementById('Submit').disabled = true;
这是我尝试失败的方法:
<script>
var $buoop = {c:2};
function $buo_f(){
var e = document.createElement("script");
e.src = "//browser-update.org/update.min.js";
document.body.appendChild(e);
};
try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
catch(e){window.attachEvent("onload", $buo_f)}
onshow: function(infos){
document.getElementById('Submit').disabled = true;
};
</script>
我是一个真正的JavaScript新手,我对此感到迷茫。谢谢。-布莱恩
这是一种方式:
onshow: function(infos){
document.getElementById('Submit').disabled = true;
}, // callback function after the bar has appeared
你也可以在其中调用一个函数。
如果您选择将其全部保留在那里,这将是完整的块。
<script>
var $buoop = {
vs: {i:6,f:2,o:9.63,s:2,c:10}, // browser versions to notify
reminder: 24, // atfer how many hours should the message reappear
// 0 = show all the time
reminderClosed: 150 // if the user closes message it reappears after x hours
onshow: function(infos){
document.getElementById('Submit').disabled = true;
}, // callback function after the bar has appeared
onclick: function(infos){}, // callback function if bar was clicked
onclose: function(infos){}, //
l: false, // set a language for the message, e.g. "en"
// overrides the default detection
test: false, // true = always show the bar (for testing)
text: "", // custom notification html text
// Optionally include up to two placeholders "%s" which will be replaced with the browser version and contents of the link tag. Example: "Your browser (%s) is old. Please <a%s>update</a>"
text_xx: "", // custom notification text for language "xx"
// e.g. text_de for german and text_it for italian
newwindow: true // open link in new window/tab
url: null // the url to go to after clicking the notification
};
function $buo_f(){
var e = document.createElement("script");
e.src = "//browser-update.org/update.min.js";
document.body.appendChild(e);
};
try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
catch(e){window.attachEvent("onload", $buo_f)}
</script>
相关文章:
- 如何使相机跟随地形's在此示例中的高度:http://threejs.org/examples/#webgl_t
- http://errors.angularjs.org/1.4.1/ngRepeat/dupes
- execCommand Customization
- 如果标记是使用 JavaScript 动态构建的,Schema.org 标记是否有效?
- AMP-HTML 页面是否必须从 ampproject.org 加载 JavaScript 库?
- 为什么可以'tI将IMG元素链接到类似于“;http://en.wikipedia.org/wiki/File:
- 无法在bl.ocks.org中查看脚本的输出
- 模块名称“;mysql”;尚未为上下文_加载.使用require([])http://requirejs.org/doc
- 全局安装grunt失败,我可以'在npmjs.org上找不到
- 如何为chart.js(chartjs.org)中的所有图表类型添加标签/图例
- Cordova/phonegap 插件兼容性问题 - org.chromium.socket / org.chromiu
- 在 php 中 whateverorigin.org 调用替换为本地代理
- 您如何在Google富集摘要测试工具中测试AngularJS网络应用程序的 schema.org 元标记
- 将 XML 字符串转换为 org.w3c.dom.Document
- Codelab(bitbucket.org) 示例步骤 6,不跨网络工作
- 如何在 JavaScript 中使用正则表达式删除 .com,.org,.co.uk,.co.us
- 检测是否存在属性为 [itemtype='http://schema.org/Offer'] 的标签的最
- Browser-Update.org customization
- 无法解析类型 org.springframework.beans.BeansException.它从所需的.class文
- org.openqa.selenium.WebDriverException: 未知错误: Runtime.evalua