javascript - Jquery refresh new opened window -


i want refresh new opened window, have link , when click on open new window , want refresh , edit new window url after 3 seconds.

$('.link').on('click', function(e) {   e.preventdefault();   window.open('/page/?q=param', '_blank');   settimeout(function(){      window.location.href = window.location.href.replace( /[\?#].*|$/, "/?q=new_value" ); }, 3000); }); 

this code refreshing original page not new one. want way refresh new one.

store new window reference , access location attribute.

var newwindow = window.open('/page/?q=param', '_blank');

you can

$('.link').on('click', function(e) {   e.preventdefault();   var newwindow = window.open('/page/?q=param', '_blank');   settimeout(function() {     newwindow.location.href = newwindow.location.href.replace(/[\?#].*|$/, "/?q=new_value");   }, 0); }); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -