天天看點

ajax 跨域解決

function _do_edit(id) {
    $.confirm({
        boxWidth: '900px',
        title: '商品編輯',
        content: '<iframe src="/index.php?call=mall.spu_edit&id=' + id + '" frameborder="0" scrolling="no" id="spuform" name="spuform" style="width:95%;height:500px;"></iframe>',
        buttons: {
            close: {text: '關閉'},
            exec: {text: '儲存', btnClass: 'btn-blue', action: function () {
                    window.frames["spuform"].document.forms["spuform"].submit();//跨域問題解決
                    location.reload();
                }}
        }, onOpen: function () {

        }
    });
}           

繼續閱讀