如何调用一个HTML页面,并使其在JavaScript中弹出窗口? [英] How to call a html page and make it as pop up window in JavaScript?

查看:701
本文介绍了如何调用一个HTML页面,并使其在JavaScript中弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

这是我的脚本:

 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;
        }
    }
);   
}


推荐答案

我只是把这个小脚本

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

这篇关于如何调用一个HTML页面,并使其在JavaScript中弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆