Javascript opening maximized window when unintended
-
18-09-2019 - |
Question
Hey. The following line was opening a 490x610 window, but after modifying some other code, it started to open up the full page new window. Any ideas as to why?
<a href="cart_display.php"
onclick="window.open('uploader/upload_files.php?order_id=32063700',
'','width=490,height=610')">Upload Here</a>
Solution
cart_display.php
is going to open since you do not return false
in your onclick
handler. Doing this will prevent the default behavior of the onclick
, which is to follow the href
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow