2

I wrote a small script for an eCommerce site that errors an order if certain conditions aren't met. Now I'm trying to write something so the continue button returns the user to their cart. I can't change the button to add a class.

The problem is that this script doesn't work in IE. I'm not overly familiar with the differences in how browsers handle JavaScript. Does anyone have any ideas?

        <script type="text/javascript">
            jQuery("#shipping-method-buttons-container .button").wrap(function() {
               var link = jQuery('<a/>');
                link.attr('href', 'http://mywebsite.com/checkout/cart/');
               return link;
            });
        </script>

Update: I have since tested this in IE9 and IE10. I'm getting this problem in all IE browsers.

1

2 Answers 2

1

you can try this:

 $("#shipping-method-buttons-container .button").click(function(){
     window.location = "http://mywebsite.com/checkout/cart/"
})
Sign up to request clarification or add additional context in comments.

Comments

1

This is working in IE and others

jQuery(function(){
    jQuery("#shipping-method-buttons-container .button").wrap(function() {
        var link = jQuery('<a></a>').attr('href', 'http://mywebsite.com/checkout/cart/');
        return link;
    });
});

Example.

2 Comments

This worked in other browsers for me outside of Magento (the software I'm using) but not inside. For some reason it still worked in Chrome but not IE in my application.
Ok, glad you got over the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.