BaronGrivet
BaronGrivet

Reputation: 4424

Link to navigate to an anchor point in another browser window

We've had an interesting request from a client. They'd like their users to have two windows/ tabs open (one content, one form) which the user switches between.

Parts of the content (which is large) relate to parts of the form (which is also large).

So they'd like the following:

The problem is if a user links from the content to the form - and then goes back to the content - any other links on content.html will either open another window/tab (if no target reference is used) or if a target reference is used form.html will be reloaded losing form data.

The ideal situation follows:

  1. The user is looking at content.html and clicks a link
  2. Another window or tab opens showing form.html
  3. The user fills in that part of the form and goes back to content.html
  4. The user clicks another link on content.html
  5. The window or tab showing form.html scrolls to the correct anchor point.

I'm not even sure if this is possible but I'm interested in people's thoughts on this problem.

Upvotes: 1

Views: 283

Answers (1)

mikevoermans
mikevoermans

Reputation: 4007

This can be done with basic JS - but rather than writing out the event handlers to listen for that - I just simplified the concept here:

http://jsfiddle.net/fMfgk/

The key is in the name parameter of window.open - keep that the same and you can keep referencing the same window.

Upvotes: 1

Related Questions