You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2006/11/28 16:40:31 UTC

Re: [OT] Scriptlet and Javascript

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adam,

LIM Adam wrote:
> I have a "javascript:history.back()" link button. When I click on it, I
> want to remove an entry in my object with scriptlet.
> The problem is that the scriptlet is executed when my page is loaded and
> not when I click on my button.
> How could I manage it?

You'll need to post your HTML code so we can better understand your
situation.

I'm not sure what you mean when you say that your scriptlet is executed
when your page is loaded. Do you mean that you have something like this:

<script type="text/javascript"><!--
  history.back();
// --></script>

... in your code? That doesn't seem right. Since you said that your
javascript code is "javascript:history.back();", I'm assuming that your
HTML is like this:

<input type="button" onclick="javascript:history.back();" />

(Note that "javascript:" is unnecessary in the "onclick" handler... it's
always javascript.)

Anyhow, I'm also unclear about what you want to do when this button is
clicked.... you want to remove an object entry? Do you mean a javascript
object, or something on the server? If you mean the server, are you
using AJAX or something like that, or do you want to call an action on
the server in order to do that (which, I guess, doesn't exactly preclude
the use of AJAX)?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbFhv9CaO5/Lv0PARAnSOAJ9D6GyUC/yFc4XMcyK0QtyoHdjvtwCgwKhI
YTk/UxpaOrJjMP0Ew2e0Kik=
=M9mj
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org