Example
Function circleonclick (EVT ){
VaR circle03 = evt.tar get
VaR id = circle03.getattribute ('id ')
Window. Location = 'HTTP: // localhost: 8080/MyApp/parse_draw.jsp? Xml = dblp. xml & author = '+ ID;
}
Or use the link
As follows:
For example
<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8"
Pageencoding = "UTF-8" %>
<%
String strstyle = request. getparameter ("style ");
String siteid = request. getparameter ("CID") = NULL? "": Request. getparameter ("CID ");
String requrl = request. getrequesturl (). tostring ();
Requrl = requrl. substring (0, requrl. lastindexof ("/"));
String prevdir = requrl. substring (0, requrl. lastindexof ("/") + 1 );
Requrl + = "/sitecounter. jsp ";
String linkto = prevdir + "admincounter/counter_admin.jsp ";
String IMG = prevdir + "images/05count.gif ";
%>
Document. Write ("<a target = 'blank 'href = '<% = linkto %>'> ");
Document. Write (" 'border = '0' width = '73 'height = '14'/> ");
Document. Write ("<SCRIPT type = 'text/JavaScript'
Src = '<% = requrl %>? Style = <% = strstyle %> & screenwidth = "+
Screen. Width + "& screenheight =" + screen. height + "& cid = <% =
Siteid %> '> ");
Document. Write ("</SCRIPT> </a> ");
Document. Write ("<SCRIPT type = 'text/JavaScript '> alert (' OK '); </SCRIPT> ");
Call it in HTML
<SCRIPT type = "text/JavaScript" src = "http: // localhost: 505/Kefu/visitcounter/webcounter/mycount. jsp"> </SCRIPT>
</Body>
Note:
1. single quotation marks and double quotation marks.
2. <SCRIPT> </SCRIPT> must be used in pairs.
3. jsp cannot contain the out. ** () statement.
4. Note tostring () Conversion When referencing JSP non-string variables in Js.