143
rated 0 times
[
144]
[
1]
/ answers: 1 / hits: 20768
/ 10 Years ago, wed, august 27, 2014, 12:00:00
I open a new tab using window.open. The new tab has a javascript myfunction
function in it defined in a script tag. From the window that opens the new window, I want to run that function.
How can I do that?
Thanks
Something like
var a = window.open(mypage.html, _blank);
a.myfunction(hi);
EDIT
This isn't working. Its not doing the alert.
opener
var w = window.open(../scripts/map.php, _blank);
w.postMessage(The user is 'bob' and the password is 'secret', *);
new tab
function receiveMessage(event) {
alert(event.data);
}
window.addEventListener(message, receiveMessage, false);
More From » jquery