I have two browser tabs, tab1 and tab2.
I have a function called execute in tab1, which I would like to call from the page in tab2.
Is that possible and if so how?
I have two browser tabs, tab1 and tab2.
I have a function called execute in tab1, which I would like to call from the page in tab2.
Is that possible and if so how?
You should show your html in the first place, but i assume your tab has a link, you could do like this:
<a href="some-path" id="tab2">Tab 2</a>
JQuery:
$('#tab2').click(function(){
// your function code here
// prevent default action
return false;
})
I really cannot understand what you mean by the question.
But you can pass javascript function references as arguments to other functions.(Be wary of object execution contexts).
So while initializing "tab2", you could send in the function reference of execute of "tab1", to "tab2".
Could have given a more definitive answer with an example , had you been clearer in your question.