如何使用纯/本机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;
}
}
);
}
答案 0 :(得分:0)
我已经找到了答案,我只是把这个小脚本
popupWindow = window.open('/test.htm', 'name', 'width=700,height=350');
popupWindow.focus();