[英]Javascript open in new tab not window
我試圖打開一個固定大小的新窗口,但它在新標簽中打開? 我知道為什么會這樣,這是我的代碼如下。
function opendialog() {
// If on a create form then save and reload so the dialog can open
if(Xrm.Page.ui.getFormType() == 1)
{
Xrm.Page.data.entity.save(null);
return;
}
// If sale appointment then trigger dialog
if (Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == true) {
window.open("/" + Xrm.Page.context.getOrgUniqueName() + "/cs/dialog/rundialog.aspx?DialogId=%1111111111111111111%7d&EntityName=appointment&ObjectId=" + Xrm.Page.data.entity.getId());
window.resize(500,500);
// Set as being displayed so it doesn't trigger again on load
Xrm.Page.getAttribute("new_PhoneCallMade").setValue(true);
}
}
function opendialogonload() {
if (Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == null
|| Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == false) {
opendialog();
}
}`
我認為你必須給窗口一個參數(寬度/高度)。
window.open(url,windowName,“height = 400,width = 200”);
在這里試試: http : //www.w3schools.com/jsref/tryit.asp?filename = tryjsref_win_open2
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.