Iframe would be one possible hack. Have the page that loads run a javascript function that drills back up to your page.

or an onload on an image, or simply execute the function in the page.

lastly have something like this in your layout

<tile:get name="javascriptHack" scope="page" />

<script language="javascript" type="text/javascript">
<!--
function myfuction() {
        <c:out value="${javascriptHack}" />;
}
//-->
</script>
<body onload="myfuction()">

Stick your method as a put in that tile and have it empty for those page where not required.

<put name="javascriptHack" value="alert('my javascript hack')" type="string" />

the rest of the time

<put name="javascriptHack" value="" type="string" />

So the function always runs just usually contains nothing.


On 2 Mar 2004, at 23:14, Alan Weissman wrote:


Hey everyone -



            So I have a Struts/Tiles page that I need to have a
Javascript function called on when the page loads.  Normally this is of
course accomplished with the BODY onLoad event however this event isn't
fired when my page loads and from doing extensive Googling I've found
that this has something to do with the nature of Struts/Tiles pages
(though I'm not sure what).  What is the best workaround for this?



Thanks so much,

Alan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to