复制代码代码如下:
<%@ Page Language = "java" import = "java.util.*" PageEncoding = "utf-8"%>
<%
String path = request.getContextPath ();
String basalepath = request.getscheme () + ": //"
+ request.getServerName () + ":" + request.getServerport ()
+ caminho + "/";
%>
<!
<html>
<head>
<base href = "<%= bashepath%>">
<title> meu jsp 'createElement.jsp' página de partida </ititle>
<meta http-equiv = "Pragma" content = "no-cache">
<meta http-equiv = "cache-control" content = "no-cache">
<meta http-equiv = "expira" content = "0">
<meta http-equiv = "palavras-chave" content = "palavra-chave1, palavra-chave2, palavra-chave3">
<meta http-equiv = "description" content = "Esta é a minha página">
<script type = "text/javascript"
src = "<%= request.getContextPath ()%>/jQuery/jQuery-1.7.min.js"> </sCript>
<script type = "text/javascript">
$ (function () {
$ ("#mas"). Clique (function () {
var para = document.createElement ("p");
var node = document.createTextNode ("这是新段落。");
para.appendChild (nó);
var elemento = document.getElementById ("div1");
element.appendChild (parágrafo);
})
})
</script>
</head>
<Body>
<div id = "div1">
<p id = "p1">
这是一个段落。
</p>
<p id = "p2">
这是另一个段落。
</p>
</div>
<input type = "button" id = "mas" value = "添加">
</body>
</html>