Skip to content Skip to sidebar Skip to footer

Javascript Function Not Working On Chrome & Ie But Works On Firefox

Recently i have developed system that has so many live calculation options. I have test these functions on Firefox but when i try to run this program in Chorme it doesn't work. It

Solution 1:

Based on the comments in your start topic, you could simply detect/rewrite the missing function:

Date.prototype.toLocaleFormat = Date.prototype.toLocaleFormat || function(pattern) {
    return pattern.replace(/%Y/g, this.getFullYear()).replace(/%m/g, (this.getMonth() + 1)).replace(/%d/g, this.getDate());
};

the rewrite would then be globally available, you could test it with this jsfiddle

Post a Comment for "Javascript Function Not Working On Chrome & Ie But Works On Firefox"