Click to See Complete Forum and Search --> : Javascript window.open
Taliv
01-21-2003, 02:22 AM
I can't believe I'm stuck on this....
I have a browser window with a table (500 rows) - including a column for name. When I click on the name I open another window with details BUT the parent window jumps up to the top - so when I close the window I have to scroll down to line 432 again.....
Any suggestions?
Webskater
01-21-2003, 03:45 AM
There's various ways of doing this.
Give each hyperlink an id or bookmark.
In the href of each hyperlink call a javascript function and pass the bookmark (or id) into the function as a parameter.
In the javascript function after you open the new window set the focus back to the bookmark (or id).
Charles
01-21-2003, 04:41 AM
Originally posted by Webskater
There's various ways of doing this.
Give each hyperlink an id or bookmark.
In the href of each hyperlink call a javascript function and pass the bookmark (or id) into the function as a parameter.
In the javascript function after you open the new window set the focus back to the bookmark (or id). I'll bet that you have another, greater problem that you don't notice, that your link doesn't work at all for the one in ten users that do not use JavaScript. The following will solve both problems:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Window Example</title>
<p><a href="http://www.w3.org" onclick="window.open(this.href, 'child', 'height=300,width=200'); return false">W3C</a></p>