struts2 标签初识 Ajax Tags
1、a
/ajax/remotelink/index.jsp
1:
2:
3:
4:
5:
6:
7:
Ajax Examples8:
9:
10:
11:
12: function handler(widget, node) {
13: alert('I will handle this myself!');
14: dojo.byId(widget.targetsArray[0]).innerHTML = "Done";
15: }
16:
17: dojo.event.topic.subscribe("/before", function(event, widget){
18: alert('inside a topic event. before request');
19: //event: set event.cancel = true, to cancel request
20: //widget: widget that published the topic
21: });
22:
23: dojo.event.topic.subscribe("/after", function(data, request, widget){
24: alert('inside a topic event. after request');
25: //data : text returned from request
26: //request: XMLHttpRequest object
27: //widget: widget that published the topic
28: });
29:
30: dojo.event.topic.subscribe("/error", function(error, request, widget){
31: alert('inside a topic event. on error');
32: //error : error object (error.message has the error message)
33: //request: XMLHttpRequest object
34: //widget: widget that published the topic
35: });
36:
37: dojo.event.topic.subscribe("/topics", function(data, type, e){
38: alert('inside a topic event. type='+type);
39: //data : text returned
40: //type : "before", "load", "error"
41: //e : request object
42: });
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59: href="%{#ajaxTest}"
60: targets="t1"
61: highlightColor="red"
62: hig