我的java代码:
//ie浏览器不支持的javascript
public Document newButton(){
XmlUtil xmlUtil = new XmlUtil();
Element button = xmlUtil.creatElemet("input");
Document document = xmlUtil.creatDocument(button);
button.setAttribute("id","uu");
button.setAttribute("type","button");
button.setAttribute("value","click me");
button.setAttribute("onclick","javascript:window.alert('xml')");
System.out.println(button.getAttributes());
return document;
} // end_class
我的页面代码:
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="STYLESHEET" type="text/css"
href="jspAgent/_css/headagent.css">
<script type='text/javascript' src='/tgtc/dwr/interface/tomajax.js'></script>
<script type='text/javascript' src='/tgtc/dwr/engine.js'></script>
<script type='text/javascript' src='/tgtc/dwr/util.js'></script>
<script type='text/javascript'>
function call(data){
window.alert(data);
window.document.write(data);
}
function calls(data){
DWRUtil.setValue('xml',data);
}
</script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<form method="get" action="bb.jsp">
<input type="text" name="hxj"value="nihao"><br>
<input type="button" value="nihao" οnclick="javascript:tomajax.myage('hxj',call)"><br>
<input type="text" id="nn"><br>
<input type="button" value="xmlbutton" οnclick="javascript:tomajax.newButton(calls);"><br>
<div id="xml"></div>
</form>
</body>
</html>
执行的结果:
关键是 我在 鼠标 单击 click me 的按钮,不执行制定的脚本语言,但是在firefox下测试可以动态执行脚本语言!这让我感到很是郁闷!!求解 ~~~~~~为何IE浏览器不支持动态新增的脚本语言呢?~~
看来微软的东东有点龌龊~~~
//ie浏览器不支持的javascript
public Document newButton(){
XmlUtil xmlUtil = new XmlUtil();
Element button = xmlUtil.creatElemet("input");
Document document = xmlUtil.creatDocument(button);
button.setAttribute("id","uu");
button.setAttribute("type","button");
button.setAttribute("value","click me");
button.setAttribute("onclick","javascript:window.alert('xml')");
System.out.println(button.getAttributes());
return document;
} // end_class
我的页面代码:
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="STYLESHEET" type="text/css"
href="jspAgent/_css/headagent.css">
<script type='text/javascript' src='/tgtc/dwr/interface/tomajax.js'></script>
<script type='text/javascript' src='/tgtc/dwr/engine.js'></script>
<script type='text/javascript' src='/tgtc/dwr/util.js'></script>
<script type='text/javascript'>
function call(data){
window.alert(data);
window.document.write(data);
}
function calls(data){
DWRUtil.setValue('xml',data);
}
</script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<form method="get" action="bb.jsp">
<input type="text" name="hxj"value="nihao"><br>
<input type="button" value="nihao" οnclick="javascript:tomajax.myage('hxj',call)"><br>
<input type="text" id="nn"><br>
<input type="button" value="xmlbutton" οnclick="javascript:tomajax.newButton(calls);"><br>
<div id="xml"></div>
</form>
</body>
</html>
执行的结果:
关键是 我在 鼠标 单击 click me 的按钮,不执行制定的脚本语言,但是在firefox下测试可以动态执行脚本语言!这让我感到很是郁闷!!求解 ~~~~~~为何IE浏览器不支持动态新增的脚本语言呢?~~
看来微软的东东有点龌龊~~~