Caliban
09-15-2003, 05:49 PM
Hi y'all, JS gurues!
I have the following issue:
I execute a page which i defined two functions: lpad and rpad
using String.prototype, like this:
================
String.prototype.lPad = function (n,c) {var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) {a.unshift (c)}; return a.join('')}
String.prototype.rPad = function (n,c) {var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) {a.push (c)}; return a.join('')}
================
My PC has IE 5.5 installed.
But, in the laptop I'm working in right now (it's not mine), it's installed IE 5.0, and when the page reaches the sentence:
miRoot = "ENTERPRISES"; miRoot = miRoot.rPad(66,' ');
a message error is shown with the following msg:
"the object does not accept this property or method"
I isolate the error and i'm 100% sure there it is where is produced, because I tested the page, commenting all the references to xxxxx.rpad() and/or xxxxx.lpad(), and the page works fine, but the texts are not justified - that's the purpose of these li'l functions.
I think the problem is the IE version, but .... what do you have to say about it?
Thanx in advance.
I have the following issue:
I execute a page which i defined two functions: lpad and rpad
using String.prototype, like this:
================
String.prototype.lPad = function (n,c) {var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) {a.unshift (c)}; return a.join('')}
String.prototype.rPad = function (n,c) {var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) {a.push (c)}; return a.join('')}
================
My PC has IE 5.5 installed.
But, in the laptop I'm working in right now (it's not mine), it's installed IE 5.0, and when the page reaches the sentence:
miRoot = "ENTERPRISES"; miRoot = miRoot.rPad(66,' ');
a message error is shown with the following msg:
"the object does not accept this property or method"
I isolate the error and i'm 100% sure there it is where is produced, because I tested the page, commenting all the references to xxxxx.rpad() and/or xxxxx.lpad(), and the page works fine, but the texts are not justified - that's the purpose of these li'l functions.
I think the problem is the IE version, but .... what do you have to say about it?
Thanx in advance.