我正在做一个使用超文本标记语言组件文件(.htc)的项目,现在我想升级这个项目,这个项目应该可以在所有浏览器上使用IE10,因为IE10不再支持htc文件。所以请给我解决方案,我们可以转换项目的一部分,我们正在使用htc文件。请参考以下代码:
this.Style.Add("BEHAVIOR", "url(xyz.htc)");我想替换这个htc文件和写在这个文件中的代码。在替换htc文件时需要放入什么。
请帮帮忙。
发布于 2014-06-26 18:01:44
将.htc (超文本标记语言组件)自定义属性更新为js,因为IE10标准模式不支持htc。
检查此link
编辑:
var Method_Behavior = {
get: function () {
return this.style.behavior
},
set: function (val) {
this.style.behavior = val
}
}
//input
if (!HTMLInputElement.prototype.hasOwnProperty("Behavior")) {
Object.defineProperty(HTMLInputElement.prototype, "Behavior", Method_Behavior);
}然后在Html页面中
<script src="new_js_file_name" type="text/javascript"></script>
<script type="text/javascript">
function loaded() {
document.getElementById("Id_Name").Behavior = "new_behavior";
}
</script>https://stackoverflow.com/questions/24427545
复制相似问题