Rav*_*thi 50 html javascript internet-explorer
我在下面的代码中使用示例菜单.
<html>
<head>
<title>Tree Demo</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jstree.js"></script>
<script type="text/javascript">
$(document).ready(function() {
/* $("#main").jstree({
"themes" : {
"theme" : "default",
"dots" : false,
"icons" : false
},
"plugins" : [ "themes", "json_data", "ui"],
"json_data" : {
"ajax" : {
"url" : "jsondata.json",
"data" : function (n) {
return { id : n.attr ? n.attr("id") : 0 };
}
}
}
});
$("#main").bind("open_node.jstree", function (e, data) {
// data.inst is the instance which triggered this event
console.log(data);
console.log($.data(data.rslt.obj[0],"folder_name"));
});
$("#main").bind("select_node.jstree", function (e, data) {
// data.inst is the instance which triggered this event
console.log(data);
console.log($.data(data.rslt.obj[0],"folder_name"));
}); */
$("#main1").jstree({
"themes" : {
"theme" : "default",
"dots" : false,
"icons" : false
},
"plugins" : [ "themes", "html_data"]
});
});
</script>
</head>
<body>
<div id="main1">
<ul>
<li><a href="javascript:void(0)">Home Folder</a>
<ul>
<li><a href="javascript:void(0)">Sub Folder1</a></li>
<li><a href="javascript:void(0)">Sub Folder2</a></li>
</ul></li>
<li><a href="javascript:void(0)">Shared Folders</a>
<ul>
<li><a href="javascript:void(0)">Shared Folder1</a></li>
<li><a href="javascript:void(0)">Shared Folder2</a></li>
</ul></li>
</ul>
</div>
<div id="main">
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当我在IE浏览器中运行上面的代码时,它显示页面的顶部(在URL栏下面)
"为了保护您的安全,Internet Explorer将此网页限制为无法运行可访问您计算机的脚本或Activex控件.点击选项.."
当我右键单击并单击允许阻止的内容时,它会运行.但我想要没有此弹出消息我需要运行代码...我怎么能自动运行这个?...
Ray*_*eng 81
还有一个代码解决方案.我在培训视频中看到了它.您可以添加一行来告诉IE本地文件是安全的.我在IE8上测试过它的工作原理.那条线是<!-- saved from url=(0014)about:internet -->
有关详细信息,请参阅https://msdn.microsoft.com/en-us/library/ms537628(v=vs.85).aspx
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function () {
alert('hi');
});
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
and*_*dyb 37
我相信这只会在这种特殊情况下在本地运行页面时出现,即从Web服务器加载apge时不应该看到这一点.
但是,如果您有权这样做,可以按照工具(菜单)→ Internet选项 → 安全性(选项卡)→ 自定义级别(按钮)→和禁用 自动提示ActiveX控件来关闭Internet Explorer的提示.
这当然只会影响您的浏览器.
har*_*ygg 15
如果你要使用
<!-- saved from url=(0014)about:internet -->
Run Code Online (Sandbox Code Playgroud)
要么
<!-- saved from url=(0016)http://localhost -->
Run Code Online (Sandbox Code Playgroud)
确保HTML文件以"/ r \n"格式保存为windows/dos格式,作为语句后的换行符.否则我无法使它工作.
配置IE以始终允许阻止内容的步骤:
Tools菜单,然后选择Options...Advanced tab..."Allow active content to run in files on My Computer".阻止的内容是Windows XP Service Pack 2的安全功能.如果您没有安装SP2,那么您将永远不会看到此消息.
发件人:如何在Internet Explorer上允许阻止的内容
| 归档时间: |
|
| 查看次数: |
133052 次 |
| 最近记录: |