focus
|
|
I'm injecting a form into a web page and the onsubmit action opens a new window. I want the focus to stay on the page that the form was injected to instead of switching to the new window that was created. I've tried
window.open('http://google.com/search?q='+this.imdbSearch.value+'','IMDBWindow');
window.setTimeout('this.focus();',500);
return false;
window.open('http://google.com/search?q='+this.imdbSearch.value+'','IMDBWindow');
window.setTimeout('window.focus();',500);
return false;
window.open('http://google.com/search?q='+this.imdbSearch.value+'','IMDBWindow');
window.setTimeout('opener.focus();',500);
return false;
window.open('http://google.com/search?q='+this.imdbSearch.value+'','IMDBWindow');
window.setTimeout('self.focus();',500);
return false;
All of these were tried with and without |
|
|
Try the blur method: http://www.javascriptkit.com/jsref/window.shtml |
