如何调用html页面并将其设置为JavaScript中的弹出窗口?

时间:2014-07-28 03:09:04

标签: javascript html popup popupwindow

如何使用纯/本机JavaScript将html页面作为弹出窗口调用?对不起,我在Javascript方面不太好。请帮我。谢谢

如何将您的给定脚本添加到我的脚本中?

这是我的剧本:

 function scanLapVerification() {
 msgbox("sendRequest: scanLapVerification");
 chrome.tabs.sendRequest(tabLapVerification, { method: "scanLapVerification" },
    function (response) {
        msgbox("receiveResponse: scanLapVerification " + jsonToString(response, "JSON"));
        // maintaining state in the background
        if (response.data.content == "address_check") {
            //open google maps with request for contact address
             var gmaps;
                if (confirm("Do you want to proceed on Google Maps and search for Contact Address?") == true) {
                gmaps = tabCreate("http://maps.google.com/maps?q=" + encodeURIComponent(response.data.contact_address));
            } else {
                gmaps = "You Cancel!";
            }
            document.getElementById("maps").innerText = gmaps;
        }
    }
);   
}

1 个答案:

答案 0 :(得分:0)

我已经找到了答案,我只是把这个小脚本

popupWindow = window.open('/test.htm', 'name', 'width=700,height=350');
popupWindow.focus();