August 2017
Intermediate to advanced
1330 pages
56h 17m
English
Let's create a new record that mirrors the first Script Include in Chapter 3, Server-Side Control.
var SimpleAdd = Class.create();
SimpleAdd.prototype = {
initialize: function (n) {
ms.log('Creating new object');
this.number = (n - 0) || 0;
},
increment: function () {
this.number++;
ms.log(this.number);
return this;
},
type: 'SimpleAdd'
}
This code is almost identical to a typical Script Include. The only difference is that the logging is done with the ms global variable instead of gs.
The script has two functions. One is run when the object is created and sets the number variable. The ...
Read now
Unlock full access