复制代码代码如下::
<%@ page Language = "java" import = "java.util.*" pageCoding = "utf-8"%>
<%
String path = request.getContextPath ();
String basepath = request.getscheme () + ": //"
+ request.getServerName () + ":" + request.getServerport ()
+ Pfad + "/";
%>
<! DocType html public "-// w3c // dtd html 4.01 transitional // en">
<html>
<kopf>
<Basis href = "<%= Basepath%>">
<title> my jsp 'createLement.jsp' Startseite </title>
<meta http-äquiv = "pragma" content = "no-cache">
<meta http-äquiv = "cache-control" content = "no-cache">
<meta http-äquiv = "abläuft" content = "0">
<meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<meta http-äquiv = "Beschreibung" content = "Dies ist meine Seite">
<script type = "text/javaScript"
src = "<%= request.getContextPath ()%>/jQuery/jQuery-1.7.min.js"> </script>
<script type = "text/javaScript">
$ (function () {
$ ("#aber"). Click (function () {
var para = document.createelement ("p");
var node = document.createTextNode ("这是新段落。");
Para.AppendChild (Knoten);
var element = document.getElementById ("div1");
Element.AppendChild (Abs.);
})
})
</script>
</head>
<body>
<div id = "div1">
<p id = "p1">
这是一个段落。
</p>
<p id = "p2">
这是另一个段落。
</p>
</div>
<input type = "button" id = "aber" value = "添加">
</body>
</html>