No such thing as a small change | |
PerlMonks |
Re: Execute javascript before setting cookie headersby cfreak (Chaplain) |
on Sep 28, 2005 at 00:19 UTC ( [id://495597]=note: print w/replies, xml ) | Need Help?? |
As it was pointed out already, you can't save an image in a cookie. You can preload images without displaying them and they will be cached. There are countless examples on the web, I trust you can use Google ;-) However you can use the onSubmit handler in the browser to execute some javascript before your form submits. Remember though: the user can turn it off, or otherwise muck with it as they see fit so don't rely on it to do any validation or set some needed parameter in your server side code If you're trying to do something with the server, then have the Javascript do something and then have the server continue .... well you can't do that, and I'm not really sure why you would want to. Javascript can set cookies itself, google for that one as well. Also as a general rule you should use CGI; which will handle cookies for you easily and safely.
In Section
Seekers of Perl Wisdom
|
|