Javascript/JQuery: focus the popup window if already opened but not to reload it -


have following code open , focus window popup, unless hasn't opened yet. works fine,

but problem after focus previous opened popup window, can't prevent reloading , makes loss of data on it.

so how can prevent existing window not reload retain existing data when link clicked again?

window.open(url,"searchpatron","height=600,width=1000, status=yes,toolbar=no,menubar=no,location=no").focus(); 

maybe fits needs:

demo

window['windows'] = {}; var url = "//testit.com"; $('button').click(function () {     var popup =  window['windows'][url]? window['windows'][url]:     window['windows'][url] = window.open(url, "searchpatron", "height=600,width=1000, status=yes,toolbar=no,menubar=no,location=no");     popup.focus(); }); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -