Post by Mihir2808 » Mon Dec 30, 2013 10:23 pm

Here's my site url: http://www.sensibletshirts.com. Its still under construction. Whenever I go to the checkout/cart page and if i click on any links or buttons before the page is fully loaded, a javascript alert box shows up saying "Error". I'm also attaching a picture of the same. Can someone please help me with it? Thank you. :)

Attachments

error.jpg

error.jpg (92.18 KiB) Viewed 801 times


Newbie

Posts

Joined
Mon Dec 30, 2013 10:11 pm
Location - India

Post by jmperea » Tue Mar 18, 2014 3:05 am

Hi,

I have the same error, Have you a solution??

thanks

Newbie

Posts

Joined
Wed Jul 24, 2013 1:46 am

Post by nitinfrnd5 » Thu Aug 27, 2015 11:53 am

I know it's a very old question, found it when I was looking for the solution of this same issue. I have now fixed it on my store and posting solution here so that other people can be benefited with it.

To block this irritating alert coming on your store, just include below script in your website header.

<script>
(function() {
var new_alert = window.alert;
window.alert = function(str) { //str variable return content which is passed to be shown in alert
str1 = str.replace(/(\r\n|\n|\r)/gm,""); //Removing line break from string
if (str1 !="error"){ //show alert only if content is not equal to 'error'
new_alert(str);
}
else{
// do nothing
}
};
})();
</script>

If you are wondering what it does:
It replaces default alert function of javascript and don't show alert when its content is 'error'.

Newbie

Posts

Joined
Thu Aug 27, 2015 11:46 am

Post by Sadhik Hussain » Wed Dec 04, 2019 1:19 pm

its really great solution for the problem. I appreciate your effort
But i am wondering how does that error occur when it is not there in default opencart installation.

asking for information.


Posts

Joined
Tue Sep 25, 2018 5:31 pm
Who is online

Users browsing this forum: No registered users and 27 guests