【发布时间】:2014-12-15 13:24:32
【问题描述】:
我的 html 中有以下代码,当我从 Visual Studio 将该文件作为网站打开时,它工作正常。但是当我双击 Test.html 并在 IE 中打开它时,它不起作用。
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Print Me That Label</title>
<script src="jquery-1.4.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
function clickMe()
{
alert("Clicked");
var labelXml = "test";
$(document).ready(function() {
$.get("DZLabel.xml", function (labelXml) {
alert("Clicked1");
document.getElementById("labelTextArea").innerText = labelXml;
}, "text");
});
}
</script>
</head>
<body>
<label for="labelTextArea">Text on the label:</label>
<textarea name="labelTextArea" id="labelTextArea" rows='2'></textarea>
<button id='printButton' onclick="clickMe()">CLICK</button>
</body>
</html>
这里 id DZLabel.xml:
<?xml version="1.0" encoding="utf-8" ?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Landscape</PaperOrientation>
<Id>Address</Id>
</DieCutLabel>
我的 IE 设置有什么问题吗?
【问题讨论】:
-
Ajax 请求不适用于通过文件系统(而不是通过 http)打开的 本地 文件
-
它可以在 chrome/others 中使用吗?
-
双击Test.html,Internet Explorer地址栏出现什么地址?
-
在点击处理程序内部有一个
ready回调没有任何意义(至少,不是针对同一页面)。 -
jQuery 1.4.3 已经 4 岁了。尝试使用当前版本。
标签: jquery internet-explorer internet-explorer-11