0

I'm not sure how to debug this particular issue at present.

If you view this category page for example and hit the 'Buy' button on the top product, a popup will appear, hit the 'Proceed to Checkout' button and a Fancybox modal appears briefly displaying a 404 error - would someone kindly use their browser dev tools and point out why it is loading the 404 error page within the Fancybox modal please?

The script that is controlling this has become a bit of a mess but I have provided it below for reference...

<script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function(){
        jQuery('.fancybox').fancybox(
            {
               hideOnContentClick : true,
               width: 382,
               autoDimensions: true,
               type : 'iframe',
               showTitle: false,
               scrolling: 'no',
               onComplete: function(){
                jQuery('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
                    jQuery('.fancybox').height(jQuery(this).contents().find('body').height()+30);
                    jQuery.fancybox.resize();
                 });

               }
            }
        );
    });
    function showOptions(id){
        jQuery('#fancybox'+id).trigger('click'); //show the custom options on click if they exist
    }
    function setAjaxData(data,iframe){
        if(data.status == 'ERROR'){
            alert(data.message); //show error message if nothing to update
        }else{
            if(jQuery('.block-cart')){
                jQuery('.block-cart').replaceWith(data.sidebar); //otherwise update the cart in the sidebar block
            }
            if(jQuery('.header .links')){
                jQuery('.header .links').replaceWith(data.toplink); //otherwise update the cart in the header block
            }
            jQuery.fancybox.close();
        }
    }
    function setLocationAjax(url,id){
        url += 'isAjax/1';
        url = url.replace("checkout/cart","ajax/index");
        jQuery('#ajax_loader'+id).show();
        try {
            jQuery.ajax( {
                url : url,
                dataType : 'json',
                success : function(data) {
                    jQuery('#ajax_loader'+id).hide(); //if success, hide #ajax_loader
                    jQuery('.popup-text').html(data.message); //if success, show .popup-text that says product is added to cart
                    jQuery('.fancy-popupbox').show(); //if success, show .fancy-popupbox content
                    //jQuery.fancybox.open('.fancy-popupbox');
                    setAjaxData(data,false);
                }
            });
        } catch (e) {
        }
    }
</script>

Please let me know if I can supply some further information on this.

4

1 回答 1

-1

以下是 Chrome 工具检测到的错误:

Uncaught SecurityError: Blocked a frame with origin "http://s3-eu-west-1.amazonaws.com" from accessing a frame with origin "http://www.showermania.co.uk". Protocols, domains, and ports must match.`` Uncaught SecurityError: Blocked a frame with origin "http://static.ak.facebook.com" from accessing a frame with origin "http://www.showermania.co.uk". Protocols, domains, and ports must match.`` Uncaught SecurityError: Blocked a frame with origin "https://s-static.ak.facebook.com" from accessing a frame with origin "http://www.showermania.co.uk". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.`` Uncaught SecurityError: Blocked a frame with origin "http://static.ak.facebook.com" from accessing a frame with origin "http://www.showermania.co.uk". Protocols, domains, and ports must match. chrome-extension://geelfhphabnejjhdalkjhgipohgpdnoc/controllers/frame.js:1 Failed to load resource

基本上,您的端口配置不正确。正如它所说,“协议、域和端口必须匹配。”

于 2013-10-08T12:44:10.900 回答