简体   繁体   中英

window.open(url,“_blank”) opens window but widens across the screen

I am facing an issue where when I click on a link and opens in a new window. It opens with the correct size window but then the window widens across the screen. My Javascript function makes an Ajax call using jQuery. Kindly help me out on how to avoid widening the window unless i maximize it.

jQuery.ajax({
  url : "xyx",
  data: xyz,
  success: function(portletURL){
    window.open(portletURL, "_blank", "directories=no,height=640,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=830");
  } 
});

Is the width of the page you're loading within this window the same (or less) as the window width you specified? I suspect the reason for the window to widen across the screen like this is because of that. Try setting resizable to no

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM