in reply to Checking forms for JavaScript
What's your objective here? I'm guessing you have some stuff from a web form that's going to go back onto a web page, and you don't want to allow any potentially nasty javascript. Based on that assumption...
You could take the easy way out and just strip anything that looks like an HTML tag. Or you could strip out <script> tags, the string 'javascript:', and any html tag attributes that have to do with javascript (onClick, onMouseOver, etc.).
Not being a javascript wiz, I'm sure I haven't covered everything, but this ought to give you a start. You might get more useful answers if you can post more details of what you're trying to accomplish with this code.
Update: corrected para 3. Of course I meant strip out <script> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Checking forms for JavaScript
by Sullust (Acolyte) on Jul 24, 2001 at 06:59 UTC |