Question
Create a property
I have an advanced JavaScript Question! As i learned it is possible to add new Functions to existing objects:
Column.prototype.isEmpty = function() { ... }
but how can i add a new property to a existing object???
For Example i want to add a new "minimumWidth " Property to the InDesign "Column" object. I have tried something like:
Column.prototype.minimumWidth = 0;
// var col = ... Get a real Column object from selection ...
col.minimumWidth = 100;
alert( "Column: " + col.minimumWidth );
This code gives the following Error (in InDesign CS2):
"Error: Object does not support the property or method 'minimumWidth'"
The above Code is valid ECMA JavaScript! Any Help???
Thanks Tilo
Column.prototype.isEmpty = function() { ... }
but how can i add a new property to a existing object???
For Example i want to add a new "minimumWidth " Property to the InDesign "Column" object. I have tried something like:
Column.prototype.minimumWidth = 0;
// var col = ... Get a real Column object from selection ...
col.minimumWidth = 100;
alert( "Column: " + col.minimumWidth );
This code gives the following Error (in InDesign CS2):
"Error: Object does not support the property or method 'minimumWidth'"
The above Code is valid ECMA JavaScript! Any Help???
Thanks Tilo
