JavaScript link taglib ver. 1.3

    Custom JSP tag. Renders a hyperlink with JavaScript. This taglib lets you use the values from your HTML forms as parameters for the hyperlinks.

For example:
 


<%@ taglib uri="taglib.tld" prefix="go" %>
<html>
...
<go:jslink href="http://www.server.com/nextpage.htm" text="Next page"/>
<go:jslink href="http://www.server.com/prevpage.htm">Link</go:jslink>
...
</html>

You can set a text for your hyperlink as a tag's body or through the parameter text or through the special tag setText. Tag setParameter lets you define a GET parameter for the link (value will be encoded automatically). For example this hyperlink will use the current value for the user field in your form:
 


<%@ taglib uri="taglib.tld" prefix="go" %>
<html>
...
<go:jslink href="http://www.server.com/nextpage.htm">
 <go:setText>Next page</go:setText>
 <go:setParameter name="A">document.forms[0].user.value</go:setParameter>
</go:jslink>
...
</html>

With parameter function tag simply creates a JavaScript function that calculates the URL according to your parameters. A link itself would be not generated in this case. This feature lets you provide dynamically calculated URL's in our Ajax taglibs.

Tags are:

jslink

Body tag renders JavaScript hyperlink. Parameters are:

1) href Optional parameter. Describes an URL. By default tag will use the current URL (request URI).
2) title Optional parameter. Describes a title (tooltip).
3) className Optional parameter. Describes a CSS class.
4) style Optional parameter. Describes a CSS style.
5) rel Optional parameter. Describes a rel attribute.
6) unique Optional parameter. Possible values are true or false. If this value is true tag adds unique parameter to link that makes it non-cached. Default value is false (do not add).
7) text Optional parameter. Describes a text for hyperlink.
8) function Optional parameter. Describes a name for the generated JavaScript function that will return an URL.

setText

Body tag defines a text for your hyperlink. Parameters are: none

setParameter

Body tag defines a parameter for your hyperlink. Parameters are:

1) name Describes a name for your parameter
 

for downloading:

 Library: jslinktag.jar     Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: