开发者

How does phpmyadmin open a small window both in firefox and IE?

开发者 https://www.devze.com 2022-12-17 00:24 出处:网络
When you edit a datetime column via its datepickup,a window pops up instead of a n开发者_如何学Pythonew tab.

When you edit a datetime column via its datepickup,a window pops up instead of a n开发者_如何学Pythonew tab.

How to do it?

I tried window.open(..) but it just opens a new tab.


I don't know phpmyadmin in particular, but could it be:

window.showModalDialog(...);

showModalDialog("URL"[, arguments[, "features"]])

http://javascript.gakaa.com/window-showmodaldialog-4-0-5-.aspx


It calls a openCalendar function which looks like this:

function openCalendar(params, form, field, type, fieldNull) {
    window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
    dateField = eval("document." + form + "." + field);
    dateType = type;
    if (fieldNull != '') {
        dateFieldNull = eval("document." + form + "." + fieldNull);
    }
} 

Basically just setting the width and height attributes (btw, if it's opening in a new tab, it's your browser that opens it that way, not the javascript).


You'll need to provide more than just the url: https://developer.mozilla.org/En/DOM/Window.open - take a look at the windowFeatures parameter. They happen to be using the following function:

function openCalendar(params, form, field, type) {
    window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
    dateField = eval("document." + form + "." + field);
    dateType = type;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消