Javascript: window.open popup on every clicks -


i using below script popup url when clicks blog page.

<script type="text/javascript"> document.body.onclick= function(){ window.open('https://mywebpage.com', 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=950, height=650, left = 300, top = 50'); }</script> 

the issue , if u user clicks anywere in blog mywebpage url pops up, many times clicks keep on pops up, need 1 time should popup webpage until session ends browser

one method have onclick switch boolean's value in 1 direction only, , have window open when boolean switched. onclick activates every click: http://www.w3schools.com/jsref/event_onclick.asp

also, should tagged javascript, not java.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -