PDA

View Full Version : Script to disable javascript?



djr33
07-31-2007, 07:28 PM
I'm just curious about this.
Is there a way that one could code javascript on a page that would disable any other javascript?

If so, then it would be possible to let people enter html directly in a page, rather than having to process it first and make sure there is no XSS, etc.

Then again, it's probably easier to just use a server side language and escape it. I'm just wondering.

Twey
07-31-2007, 08:05 PM
I don't think so. The Javascript is added to the page without going through the usual createElement() &c. methods, so I think the answer is probably no.

tech_support
08-01-2007, 12:36 AM
How about removing the script element?

Twey
08-01-2007, 05:14 AM
But you'd have to poll to check when exactly the script element was added, and it's likely that the script would already have run in the poll interval.