问题
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