N00b question about function initiation

I’ve got an issue at the moment in that my script looks like this:



var JimCode = function () {

    this.pageCode = {
      blah: function(){
        blah;
      }
    };

pageCode.blah();

}();


The script runs fine, but then it seems to run again, overwriting all the data…

Any help would be greatly appreciated - I’m sure it’s something really n00by that I’m doing! :slight_smile:

Thanks

Jim

Actually it seems like the page reloads when the JimCode Function completes…

Still confused. :frowning:

Live example here

I had set the input type to submit, rather than button… sorry!! :slight_smile: