How to call a html page and make it as pop up window in JavaScript?

瘦欲@ 提交于 2019-12-08 12:22:28

问题


how to call a html page as a pop up window using pure/native JavaScript? Sorry, I'm not so good in Javascript. Please help me. Thank you

How can I add your given script into my script?

Here's my script:

 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:


I already found the answer, I just put this little script

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


来源:https://stackoverflow.com/questions/24987938/how-to-call-a-html-page-and-make-it-as-pop-up-window-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!