Hello. This is my third post on this topic. I got great replies on how to remove duplicates from the string. But unfortunately all of them are not working in IE on Mac OS9. Here is what I've been using so far. And it works great in IE and Netscape on Windows platform but doesn't work in IE5.1 on Mac OS9. Can someone help me with Mac/Windows compatible code. May be the simpler way of doing it will work, if there is such. Thanks.
____________________________________________________
Array.prototype.removeDuplicates = function()
{
var newArray = new Array();
for (var i = 0; i < this.length; i++)
{
if (!newArray.contains(this))
{
newArray.push(this)
}
}
this.length = 0;
for (var i = 0; i < newArray.length; i++)
{
this.push(newArray)
}
return this;
}
Array.prototype.contains = function(elm)
{
var len = this.length;
for (var i = 0; i < len; i++)
{
if (this == elm)
{
return true
}
}
return false
}
____________________________________________________
Array.prototype.removeDuplicates = function()
{
var newArray = new Array();
for (var i = 0; i < this.length; i++)
{
if (!newArray.contains(this))
{
newArray.push(this)
}
}
this.length = 0;
for (var i = 0; i < newArray.length; i++)
{
this.push(newArray)
}
return this;
}
Array.prototype.contains = function(elm)
{
var len = this.length;
for (var i = 0; i < len; i++)
{
if (this == elm)
{
return true
}
}
return false
}