7 examples of 'html popup message' in JavaScript

Every line of 'html popup message' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
3function showInfoMessagePopup(messageContentId) {
4
5
6// build popup
7var frame = jQuery("<div></div>").css({border:'2px', backgroundColor:'white', borderStyle:'outset', borderColor:'black'}).hide().appendTo('body')
8var border = jQuery("<div style='text-align:right'></div>").css({backgroundColor:'#CCCCCC', cursor:'hand'})
9var close = jQuery("<img src='icons/delete_red.png'/>").css({cursor:'hand'})
10close.click(function(e) { frame.hide()})
11close.appendTo(border)
12border.appendTo(frame)
13var content = jQuery("<div></div>").css({padding:'2px'}).appendTo(frame)
14var popup = jQuery('#' + messageContentId).clone(true)
15popup.show()
16content.html(popup);
17frame.css({position:'absolute', zIndex:'500'})
18
19// handle centering
20var windowWidth = document.documentElement.clientWidth;
21var windowHeight = document.documentElement.clientHeight;
22var popupW = frame.width();
23var popupH = frame.height();
24var popupTop = windowHeight/2 - popupH/2;
25var popupLeft = windowWidth/2 - popupW/2;
26if (popupTop<=0) {
27 popupTop=10;
28}
29if (popupLeft<=0) {
30 popupLeft=10;
31}
32
33frame.css({top: popupTop, left: popupLeft})
34
35// show
36frame.fadeIn()
37}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

9function showPopup(popup) {
10 if (!popupQueue.length) {
11 popup.show();
12 }
13 popupQueue.push(popup);
14}
34function updatePopup(icon, message, error) {
35 ports.forEach(function (port) {
36 chrome.pageAction.setIcon({ tabId: port.sender.tab.id, path: icon });
37 });
38 popupMessage = message;
39 popupError = error;
40}
238export function setup_message_popup() {
239 $(document).on("click", ".message-close", function close_popup() {
240 $(this).closest(".message-popup").remove();
241 });
242}
66function popupWindow(message) {
67 /*
68 * Show popup window with message.
69 */
70 let deleteConfirmBtn = $("#delete-confirm");
71 deleteConfirmBtn.click(() => {
72 $("#mass-action").val("delete");
73 $("#sacrud-form").submit();
74 });
75 $("#modal1").openModal();
76}
11function ShowHtmlString(title,strHtml,width,height)
12 {
13 pop=new Popup({ contentType:2,isReloadOnClose:false,width:width,height:height,isSupportDraging:true});
14 pop.setContent("contentHtml",strHtml);
15 pop.setContent("title",title);
16 pop.build();
17 pop.show();
18}
37function popupwin(content) {
38 op = window.open();
39 op.document.open('text/plain');
40 op.document.write(content);
41 op.document.close();
42}

Related snippets