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>