View Single Post
  #4 (permalink)  
Old March 17th, 2006, 10:17 PM
nzakas's Avatar
nzakas nzakas is offline
Wrox Author
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts

Perhaps localeCompare isn't available in Safari? If you feel like experimenting, try this JavaScript code:
If this outputs "undefined", then that means Safari doesn't support this method. In that case, you can create it yourself:
String.prototype.localeCompare = function (sOther) {
    if (this < sOther) return -1;
    else if (this > sOther) return 1;
    else return 0;

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
Reply With Quote