Query re new window

T

thedarkman

On my websites, when I click on a link, I am transferred to a new
page.

It is also possible to open the new page but keep the old one open.

Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

Thanks
 
D

Doug Miller

On my websites, when I click on a link, I am transferred to a new
page.

It is also possible to open the new page but keep the old one open.

Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

No.
 
P

P E Schoen

"thedarkman" wrote in message
On my websites, when I click on a link, I am transferred
to a new page.
It is also possible to open the new page but keep the old one open.
Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

I think the default behavior of a link is to open a new page that replaces
the previous one, in the current browser and tab, so that the BACK button
returns to the page where the link was clicked. But on one forum I frequent,
there is an option to open the link in a new tab, or a new window, which is
another instance of the browser. Before tabs were introduced, there were
only the two choices. I'm not sure what code is involved for these choices,
but I know you can create a child window, although I think that is yet
another option.

I doubt there is any easy way to change the default action of the (client
side) browser with a server-side text file. But it may be possible to add
code to the web page that looks for such a file on the server and changes
its behavior accordingly, although I think it would be more appropriate to
use a client-side cookie where the user may adjust his/her own preference.

Paul
 
T

Tim Streater

thedarkman said:
On my websites, when I click on a link, I am transferred to a new
page.

It is also possible to open the new page but keep the old one open.

Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

You need to put:

target='_blank'

in each of your links where you want a new window while keeping the old
one.
 
J

Jonathan N. Little

Tim said:
You need to put:

target='_blank'

in each of your links where you want a new window while keeping the old
one.

Not in my browser. I have it set not to. Doug is correct the answer is "no"
 
P

picayunish

On my websites, when I click on a link, I am transferred to a new
page.

It is also possible to open the new page but keep the old one open.

Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

No, not in robot.txt file.

Can use a target="_blank" in an anchor.

Or use a jacascript eg.

In the <HEAD> before <BODY>
<script type="text/javascript">
var newWindow
function makeNewWindow1() {
newWindow =
window.open("http://url","sub","toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,menubar=yes,personalbar=yes,width=792px,height=443px")
}

function closeNewWindow() {
newWindow = window.close()
newWindow = null
}
</script>

eg. anchor
<a href="http://url" onClick="makeNewWindow3();return false">blah blah</a>


However a lot of people have in the browser Javascript / pop-up
disabled. They find it very annoying.
So designers are recommended nit to use pop-up scripts.
 
A

Adrienne Boswell

thedarkman said:
On my websites, when I click on a link, I am transferred to a new
page.

It is also possible to open the new page but keep the old one open.

Is there a code you can put in the root directory, a bit like
robots.txt to alter this?

Thanks

If you would like to keep the current tab or window open when you click
on a link, then right click on it and choose open in new window or tab.
Please don't try to force new windows/tabs on your visitors.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top