My question开发者_C百科 is, how to to use Same function in Two different tabs at same time. Simply Like browser, multiple Tabs loading simultaneously. How to do like this in JavaSript or jQuery.
You would typically just include that function in the javascript for both of those pages.
If the two pages are from the same origin (e.g. same domain), then they can technically communicate with one another and one page could tell the other to execute a function on it's behalf, but if you are just trying to share code, then it's way easier to just include a copy of the code in both pages.
If you're including the same xxxxx.js file in both pages, it will likely be cached in the browser and will load quickly from cache after it's first load.
If you're controlling when the tab is opened, you can make a variable for this tab and target that:
var newWindow = window.open(this.getAttribute('href'), 'name');
newWindow.function();
But it's hard to tell what you're asking.
精彩评论