Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

Javascript pop up window

I am trying to open a Javascript pop up window without the minimize, maximize or close buttons.
Please advise how can this be achieved.
Thanks in advance.
0
vdesai_8
Asked:
vdesai_8
  • 4
  • 2
  • 2
  • +3
1 Solution
 
Steve BinkCommented:
I do not believe this is possible with javascript.  The control box (min,max,close buttons) are a function of the windows environment, not the browser.  Since you have no control of the remote system through javascript, you probably cannot affect their presence or appearance.

If you code the script into a java applet with permissions to run remotely, you might be able to.  Not being familiar with java, I can't lend any assistance along that line.
0
 
Michel PlungjanIT ExpertCommented:
you are correct.
Using window.open it is not possible.
If you can load the page from harddisc, you can use HTA (html applications)

However using something like submodal, you can fake the window with a layer:

http://www.subimage.com/dhtml/subModal/
0
 
GawaiCommented:
if you are talkig abot popup window you cant do that.
but there is a trick to display a window without buttons. it will be a layer.

http://developer.apple.com/internet/webcontent/hideshow_layer.html

http://developer.apple.com/internet/webcontent/examples/popup.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GawaiCommented:
<script>
function ShowDiv(DivName)
      {
            if      (document.layers) {
                  document.layers[DivName].visibility="visible";
            } else if (document.getElementById) {
                  document.getElementById(DivName).style.display="";
                  document.getElementById(DivName).style.visibility="visible";
            } else if (document.all) {
                  document.all(DivName).style.display="";
                  document.all(DivName).style.visibility="visible";
            }
      }

      function HideDiv(DivName)
      {
            if      (document.layers) {
                  document.layers[DivName].visibility="hidden";
            } else if (document.getElementById) {
                  document.getElementById(DivName).style.display="none";
                  document.getElementById(DivName).style.visibility="hidden";
            } else if (document.all) {
                  document.all(DivName).style.display="none";
                  document.all(DivName).style.visibility="hidden";
            }
      }
</script>

      <DIV id="popup" style="Z-INDEX: 999; LEFT: 40%; VISIBILITY: hidden; WIDTH: 239px; POSITION: absolute; TOP: 300px; BACKGROUND-COLOR: #3f3f3f">

        <div id="CloseWindow" align="right" style="height:77px; font-size:10px;">
          <div style="padding-top:5px; padding-right:8px;"><a href="javascript:HideDiv('popup');" style="color:#ffffff;">X Close</a></div>
        </div>

      </DIV>

<a href="javascript:ShowDiv('popup');" class="White" title="popup">Show Popup</a>
0
 
Michel PlungjanIT ExpertCommented:
a better way is
<a href="#" onClick="ShowDiv('popup'); return false"
0
 
Pravin AsarPrincipal Systems EngineerCommented:
You can not disable minimize , but you can disable maximize, addressbar  option with IE 7


function OpenCenWindow (imgURL, winname, width, height) {
  var x = 0.5 *(window.screen.width - width);
  var y = 0.5 *(window.screen.height - height);
  var posStr = ", screenX=" + x + ", screenY=" + y;
  if (popWin!= null)  {
                  popWin.close();
  }
  if (document.all) {
             posStr = ", left=" + x + ", top=" + y;
  }
  var pStr = 'resizable=no, status=no,width=' + width + ', height=' + height +
             ', alwaysRaised=1, addressbar=no, titlebar=no, toolbar=no, menubar=no' +
             ', minimize=no,maximize=no, status=no';
  popWin = window.open ("", winname,pStr +posStr );
  var imgStr = "<img src=\"" + imgURL.src + "\"  width=\"" + width + "\""
                                          + " height=\"" + height + "\">";
  popWin.document.write (imgStr);
  popWin.onblur = function () { self.window.close(); }
  popWin.onmouseout = function () { self.window.close(); }
  popWin.focus();
}

0
 
Michel PlungjanIT ExpertCommented:
this is not correct syntax, spaces are not allowed
 var pStr = 'resizable=no, status=no,width=' + width + ', height=' + height +
             ', alwaysRaised=1, addressbar=no, titlebar=no, toolbar=no, menubar=no' +
             ', minimize=no,maximize=no, status=no';

 var pStr = 'width=' + width + ',height=' + height +
             ',alwaysRaised' +
             ',minimize=no,maximize=no';

should be enough if that is possible (which I doubt)
0
 
vdesai_8Author Commented:
Thanks Gurus for your replies. I get your point but what I am trying to do is pop up a modal dialog box. If the user is inactive(no mouse or keyboard movement) for 5 minutes, I want to ask the user for password again. If the user enters it he should be able to continue the session otherwise he should be logged out. Seems from your replies that its not possible with Javascript. Could you please advise some other way around to accomplish this?

Thanks!
0
 
Steve BinkCommented:
You can use the javascript confirm() dialog box.  After a delay of 5 minutes, pop up a confirmation.  If they hit 'OK', take them to the login/authentication page.  If they hit 'Cancel', finish logging them out and redirect them to an index.

IMHO, you should just automatically log them out after 5 minutes and have them log back in.  You would essentially be doing the same thing by just asking for their password.
0
 
Michel PlungjanIT ExpertCommented:
Using the submodal and ajax, it is possible to pop the login box from the same server...
0
 
LeeKowalkowskiCommented:
I'd recommend you stick to the standard client/server model, which is if the browser has not interacted with the server for 5 minutes (quite short that), not if the user has not interacted with the keyboard or mouse.

--
Lee

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now