I am trying to call the function MyMethod from within a object but none of the syntax below works. There must be a really obvious error below but I can\'t see it.
There are two main problems
text/javascript
text/jscript
So:
function MyObject() { this.MyMethod = function () { alert('It works'); } this.MyMethod(); //should now work } var test = new MyObject();