在html中点击按钮弹出对话框,内容取自txt文件

我想要实现在html中点击按钮弹出对话框,对话框的内容取自同目录下的某个txt文件,不知道怎样才能实现?求指导

html文件:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(".xml").load("txt.xml");//加载xml中的文字
$(".btn").click(function(){
confirm($(".xml").text());//弹出文字
});
})
</script>
<body>
<input class="btn" type="button" value="弹出文字" />
<div class="xml" style="display: none;"></div>
</body>
</html>

xml文件:
<div>测试文字</div>
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-02-20
这个需要网站后台语言的支持,需要php或者asp或jsp 前台配合JS的Ajax技术
相似回答