Allow users to submit javascript codes

would this be enough to allow users to submit javascript code through a form

im thinking about starting a jsfiddle style site, just worried about security


The HTMLPurifier library basically just strips code when it enters the backend of your site, anything on the frontend would need to be checked line by line for harmful code so it might be best to research javascript injection prevention techinques and snippets before you go forth with this.

thats what i thought… so does jsfiddle check code line by line… seems like you can type just about anywhere on there