The browser has two tabs opened with the different URL.
The data received by one html page from server…
Is it possible to display the same data in another tab which is already opened without reloading…If so how should that has to be done…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, if either:
Your code opened the other tab (via
window.open), orThe window has a name (such as one assigned via the
targetattribute on a link, e.g.target="otherwindow")Additionally, the window’s content must be on the same origin as the document you’re interacting with it from, or you’ll be blocked by the Same Origin Policy.
1. If you’re opening it via
window.openwindow.openreturns a reference to thewindowobject for the window that was opened, which (assuming it’s on the same origin) you can do things with. E.g.:You can use all of the usual DOM methods. If you load a library in the other window, you can use that as well. (It’s important to understand that the two windows have two different global namespaces, they’re not shared.)
Here’s a full example. I used jQuery in the below just for convenience, but jQuery is not required for this. As I said above, you can use the DOM directly (or another library if you like):
Live Copy | Live Source
HTML:
JavaScript:
2. If you’re opening it via a link with
targetwindow.opencan find and return a reference to that window:Note that the URL argument is empty, but we pass it the name from the
targetattribute. The window must already be open for this to work (otherwise it will open a completely blank window).Here’s the above example, modified to assume you’ve opened the window via
<a href="..." target="otherwindow">...</a>:Live Copy | Live Source
HTML:
JavaScript: