in reply to Re: Re^5: Executing Javascript from HTML pages in perl
in thread Executing Javascript from HTML pages in perl

Sure, but if you're writing a script on top of LWP, chances are it isn't a graphical user agent but rather some sort of bot or spider - and then it doesn't matter whether you execute the Javascript or not.

(Besides, although this is a different issue, I try to avoid DHTML altogether - try css/edge for some amazing demos of what's possible purely with CSS. And XSL has the potential to take that to yet another level. The advantage is that since these techniques do not use side effects, unlike Javascript, they can be (attempted to be) interpreted sensibly by any agent, whether it be a graphical client, a braille reader or voice synth for disabled folks, some kind of spider, a printing engine or whatever else you might come up with. How should a voice synth convey a Javascript popup menu?)

Makeshifts last the longest.

  • Comment on Re^7: Executing Javascript from HTML pages in perl

Replies are listed 'Best First'.
Re: Re^7: Executing Javascript from HTML pages in perl
by jryan (Vicar) on Nov 07, 2002 at 17:23 UTC
    <html> <head> <script> document.location.href="http://www.perlmonks.org"; </script> </head> <body> This site has moved. You will be redirected shortly. </body> </html>

    How would LWP know to redirect without executing the javascript?

    Speaking of CSS, my personal website ain't too shabby either ;)

      Anyone who uses javascript to redirect instead of the META refresh tag should be shot.

        While true, that doesn't stop people from doing it. Heres perhaps a better example:

        <html> <head> <script> if (document.all) //IE4,5 loc = 'index-ie4-5.html' else if (document.layers) //NS4 loc = 'index-ns4.html' else if (document.getElementById) //new browser loc = 'index.html' document.location.href = loc; </script> </head> <body> This site has moved. You will be redirected shortly. </body> </html>

        How would an LWP script handle this?