in reply to PERL + javascript popup

If you haven't already, I would suggest installing firefox and the firebug extension which will allow you to run the code in a debug window. But the most likely scenario that's going on here, is that the page is being cached in the browser. Try adding a random number as a parameter to the url (i.e., use url + '?X=' + Math.random() in place of url) and see if that makes the problem go away.
Donald Hosek, Tech Lead at oversee.net
L.A. perl people, we're hiring.

Replies are listed 'Best First'.
Re^2: PERL + javascript popup
by adrive (Scribe) on Mar 05, 2008 at 07:03 UTC
    dhosek, you might be right, but i restarted my pc, cleaned my cache and it didn't work. then i went ahead to try appending a random number besides its url and it worked just fine! peculiarly though, im actually using IE 7.0.5730.11, while my friend is using 7.0.5730.11RC and he didn't had any prob without the random numbers. Firefox also worked fine.
      Yeah, it's a browser-dependent thing. IE tends to be the most egregious offender in the unintended caching thing, as it tends to ignore nocache directives (but not, as you noticed, consistently).

      The other option to consider would be to do this through an Ajax call: Set up a div to hold the updated info, and have the button action do an XHR to update the div. I would suggest not writing the code directly, but using a pre-existing library (jquery and yui are relatively lightweight, I'm partial to prototype, my JS guy from a previous job swore by mootools, it's all religion ultimately). Once you start doing the Ajax-y stuff, you discover that the old way of doing things is just painful.

      Donald Hosek, Tech Lead at oversee.net
      L.A. perl people, we're hiring.