Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Generating JavaScript from Perl (article in DDJ)

by Biker (Priest)
on Apr 11, 2002 at 07:21 UTC ( #158240=note: print w/ replies, xml ) Need Help??


in reply to Generating JavaScript from Perl (article in DDJ)

I do that quite often myself. I have a rather complex Intranet Web site. I generate a lot of JavaScript from my Perl code.

The trick is to know what should be done by JavaScript. And then starts the old and true mantra...

"Never trust a users input data."

The users input data is no more trustworthy because it's been mangled by JavaScript. The JavaScript code can be executed completely under the users control.

OTOH, JavaScript can be very helpful to show the user how to navigate the site, how to fill in the data entry fields, giving dynamic help and hints depending upon already chosen options or data entered in key fields.

The important thing to remember is that when the data is sent up to the server, it must be verified a second time. And that the server script is the ruling body. If the JavaScript approved the data but the server side script doesn't, then the JavaScript is wrong.

JavaScript has been given a bad reputation. I believe this is because JavaScript has been used for things it definitively should not be used for. It's supposed to be a help for the user, think user interface, not to be part of the data processing software.


Everything went worng, just as foreseen.


Comment on Re: Generating JavaScript from Perl (article in DDJ)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-12-29 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls