[英]Javascript open in new tab not window
im trying to open a new window with a fixed size, but instead it open up in a new tab? 我试图打开一个固定大小的新窗口,但它在新标签中打开? Im sure why this is, here is my code below.
我知道为什么会这样,这是我的代码如下。
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();
}
}`
I think that you have to give a parameter to the window (width/height). 我认为你必须给窗口一个参数(宽度/高度)。
window.open(url, windowName, "height = 400, width = 200"); window.open(url,windowName,“height = 400,width = 200”);
Try it here: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open2 在这里试试: http : //www.w3schools.com/jsref/tryit.asp?filename = tryjsref_win_open2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.