0

現在、この特定の問題をデバッグする方法がわかりません。

たとえば、このカテゴリ ページを表示し、一番上の製品の [購入] ボタンをクリックすると、ポップアップが表示され、[チェックアウトに進む] ボタンをクリックすると、Fancybox モーダルが表示され、404 エラーが短時間表示されます。ブラウザを使用してください。開発ツールを調べて、Fancybox モーダル内で 404 エラー ページをロードしている理由を指摘してください。

これを制御しているスクリプトは少し混乱していますが、参考までに以下に示します...

<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>

これについてさらに情報を提供できるかどうか教えてください。

4

1 に答える 1