That restriction on body onload is a killer! Perhaps we need to create a
second <script> block, after </body> but before </html>?
There's no reason why you couldn't have, in your script, ...
<body>
...
var myVariable = ....;
function ${some.symbol)()
{
myVariable = ....;
}
There isn't a nice neat way to propogate a variable declaration to the top
of the <script> block, but that isn't very necessary (just pretty).
----- Original Message -----
From: "Craig Goss" <[EMAIL PROTECTED]>
To: "Tapestry-Developer" <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 7:23 PM
Subject: [Tapestry-developer] scipt questions
> A couple of script questions:
>
> 1. A number of personal firewalls (ie ZoneAlarm) now offer popup blocking.
> This feature disables <body onload> and prevents Tapestry from completing
> script initializations. There are ways to get around this problem
>
(http://www.projectseven.com/faqbase/faqs/faq18.asp?cat=-1&ts=body+onload&pg
> =1&id=18), but they don't seem to fit well into Tapestry's scripting
> environment. Any practical suggestions on how this problem might be
> addressed in the "Tapestry way". Even better would be a native framework
> solution that would avoid this problem.
>
> 2. Is there some way to include a global variable declaration in the
.script
> or am I stuck with including it in a .js (the only way I have found to
make
> it work so far)? In case I haven't made myself clear, my script contains
> code that allows it to track a menu item's state and reset it on the next
> click.
>
> =========== partial contents of my.script:
>
> <include-script resource-path="my.js" />
>
> <let key="item">
> document.${itemName}
> </let>
>
> function ${onMouseClickName}()
> {
> <!-- reset remembered image object -->
> if (resetItem != undefined) {
> resetItem.src = resetItem.defaultimage;
> }
>
> <!-- change state of image object -->
> $(item).src = ${item}.selectimage;
>
> <!-- remember image object for next time -->
> resetItem = ${item}
> }
>
> function ${onLoadName}()
> {
> <!-- have image remember various states -->
> ${item}.src = ${defaultImageURL};
> ${item}.defaultimage = ${defaultImageURL};
> ${item}.selectimage = ${selectImageURL};
> }
>
> =========== contents of my.js:
>
> <!-- its lonely in here -->
> var resetItem;
>
>
>
>
>
> -------------------------------------------------------
> In remembrance
> www.osdn.com/911/
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer