📄 ajax.jsp
字号:
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<%@ taglib uri="/WEB-INF/ajaxtags.tld" prefix="ajax" %>
<html>
<head>
<title>AJAX Tags (C) 2005 Jenkov Development</title>
<link rel="stylesheet" href="/prizetagsdemo/stylesheet.css" type="text/css">
</head>
<body>
<h2>Prize Tags - AJAX Tags Demo - Links</h2>
<script type="text/javascript" src="jenkov_ajaxScript.js"></script>
<ajax:reload targetElement="refreshingElement" time="5000">
refreshing.jsp
</ajax:reload>
<table class="tableBordered">
<tr><td width="75%">
<p><span class="head2">AJAX Example</span><br/><br/>
AJAX is short for Asynchronous JavaScript And XML.
</p>
<p>
Basically
AJAX means you can reload parts of an HTML page without reloading
the whole page. This makes it possible to create a faster and
nicer feeling website or web app. It takes less time to generate
the HTML for a part of a page than regenerating the whole page.
It also takes less bandwith as there is less data to transport.
Refreshing only part of a page can also reduce the blinking
of web page refreshes.
</p>
<p>
Try clicking the links below to change the lower of the two
texts on the right.
<br/><br/>
<ajax:link targetElement="linkElement">
<a href="data1.jsp" >Click to change to text 1 using Ajax Tag</a>
</ajax:link>
<br/>
<ajax:link targetElement="linkElement">
<a href="data2.jsp" >Click to change to text 2 using Ajax Tag</a>
</ajax:link>
<br/>
<ajax:link targetElement="linkElement">
<a href="data3.jsp" >Click to change to text 3 using Ajax Tag</a>
</ajax:link>
</p>
<p>
As you can see the main page doesn't refresh. To prove this look
at the time stamp at the bottom. That time stamp changes whenever
you refresh the whole page.
</p>
<p>
Last refresh: <%=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())%>
</p>
</td>
<td valign="top" bgcolor="#eeeeee"><table>
<tr><td id="refreshingElement">This text is reloaded automatically</td></tr>
<tr><td > </td></tr>
<tr><td id="linkElement">This text is changed by clicking the links</td></tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -