Posted by Tetraboy in
Wednesday, November 14. 2007
<script type="text/javascript">
function form() {
function validate(s) {
return s;
}
this.validate = validate;
this.var = "!";
}
form = new form();
document.write(form.validate("hello world") + form["var"]);
</script>
Coming from PHP and C type coding, this makes absolutely no sense. It does, however, work. It also gives me some ideas for it's use.
My reason for writing this post it to ask for your help. Readers of the world: Do you know a website that clearly explains how one would write a "class" with methods and properties in javascript? Despite my googling, I had to figure this one out myself by trial and error. Perhaps I just need a good JS reference. Where is the JavaScript manual?