在FireFox中渲染其他HTML会导致轻微挂起

时间:2015-04-26 21:10:42

标签: jquery html css ajax firefox

好的,所以我遇到了一个奇怪的问题。

我通过AJAX加载一些HTML,它有效地呈现为模态。它只是一个简单的AJAX加载,并将其附加到正文中。

在Chrome中运行良好,但在Firefox中,我可以轻松挂起任何内容(包括右键单击,或突出显示文本或任何内容!)

所有JavaScript都是:

       $.get("<?php echo $this->getUrl("b2b/index/addconfigurable"); ?>",{
           pid: $(this).attr('data-pid')
       },function(res){
           $("body").append(res);
        jQuery(".closemodalx,.closemodal").click(function(){
        jQuery(".viewproductmodal").fadeOut(function(){
            jQuery(".viewproductmodal").remove();
        })
        });
       },'html')

生成的HTML同样直截了当:

<div class='viewproductmodal'>
    <div class='closemodalx'>X</div>

        <div class='addconfblock'>
        <h2>Product Name</h2>
    <form action="/formurl/" method="post" id="product_addtocart_form" > enctype="multipart/form-data" target='ajaxframe'>        

    <div class='addblock'>

    <div class='closemodal'>Continue Shopping &nbsp; ></div>
    <div class='available'></div>
    <input type='text' name='qty' />
    <button type="submit" title="Add to Cart" class="button btn-cart"><span><span>Add to Cart</span></span></button>
    </div>
</form>

</div>
    <iframe name='ajaxframe' src='about:blank' style='border:0;width:0px;height:0px;'></iframe>    

</div>

因此,我不确定导致轻微延迟的原因 - 是否有人对此有过任何体验,并且有什么方法可以解决这个问题吗?

谢谢!

0 个答案:

没有答案