我想在 cjuidialog 中保存后打开新标签。我用了
window.top.location.href
它的工作,但没有打开新标签,但如果我使用
window.open('https://api.whatsapp.com/send?phone=+62878787811423&text=Tesdawks', '_blank');
它不起作用。这是我的完整代码
<?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'cru-dialog',
'options'=>array(
'title'=>'Detail view',
'autoOpen'=>false,
'modal'=>true,
'width'=>'80%',
'height'=>450,
'close'=>'js:function(){
$("#cru-frame").attr("src","");
$.fn.yiiGridView.update("indexKonsumen-grid", {
data: $(this).serialize()
});
}',
),
));
?>
<iframe id="cru-frame" width="100%" height="100%"></iframe>
<?php $this->endWidget(); ?>
我的控制器
if(isset($_POST['wa'])){
echo CHtml::script("window.parent.$('#cru-dialog').dialog('close');
window.parent.$('#cru-frame').attr('src','');
window.open('https://api.whatsapp.com/send?phone=+62878787811423&text=Tesdawks', '_blank');
");
}