Posted By

magicrebirth on 09/02/10


Tagged

js textmate window popup


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

koyotebr
lanabear


JS: open popup window


 / Published in: JavaScript
 

  1. // construct for explorer compatibility
  2. var newwindow = '';
  3. // EG: pop_up_window("http://www.google.com", 200, 200)
  4. function pop_up_window(url, sizeh, sizew) {
  5. if (!newwindow.closed && newwindow.location) {
  6. newwindow.location.href = url;
  7. }
  8. else {
  9. newwindow=window.open(url,'name','height=' + sizeh + ', width=' + sizew + ', status=1, resizable=1, location=1, scrollbars=1 '); /*resizable=1*/
  10. if (!newwindow.opener) newwindow.opener = self;
  11. newwindow.moveTo(100,100);
  12. }
  13. if (window.focus) {newwindow.focus()}
  14. return false;
  15. }

Report this snippet  

You need to login to post a comment.