Tuesday, 11 December 2012


Running example for me to learn

Running example http://jsfiddle.net/cpoDesign/Cze3X/6/

Creating OOP for js can be done as following.

var masterPage ={
    confirmBoxMsg: 'Selection not available.',  
            width: 'auto',
    showAlert: function(){    
    showAlertWithAttr: function(variable){
    showAlertWithFromSettings: function(){
        alert('Reading version:'+ this.settings.version);
    dataAccess:function(url,arguments, complete, errorEvent){
            success: complete,          

// calls logic in printing
// logic with wariable
//masterPage.showAlertWithAttr('variable value');

// logic to read variables from object
// using ajax call to do some work (not working yet)
    //alert('loaded' + res.responseText);},function(){alert('failed');});