struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Geppert <>
Subject Create a single javascript
Date Wed, 12 Aug 2009 12:46:06 GMT


maybe anybody can give my some input for an idea I have today.
I work on the current struts2-jquery-plugin.

At the moment the tags create after each generated html tag 
an separate <script> tag like this:

<div id="mydiv1"></div>
<script type="text/javascript">
$(document).ready(function () { do something with mydiv1; });
<div id="mydiv2"></div>
<script type="text/javascript">
$(document).ready(function () { do something with mydiv2; });

This looks a little bit dirty, so I look for a way to collect all the
generate javascript stuff
to one big javascript 

<div id="mydiv1"></div>
<div id="mydiv2"></div>
<script type="text/javascript">
$(document).ready(function () { do something with mydiv1;  do something with
mydiv2; });

Maybe all the generated javascript can be put on an Stack
and can be rendered with an separate sj:footer tag.

The JSP can look like this:
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
    <sj:div id="div1"></sj:div>
    <sj:div id="div2"></sj:div>
    <sj:a id="link1" href="%{ajaxurl}" target="result">Link</sj:a>
    <sj:datepicker />

Is there a way or should I put this idea out of my mind?

Best Regards
Johannes Geppert


View this message in context:
Sent from the Struts - Dev mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message