Solved

New Page

Posted on 1998-07-28
3
186 Views
Last Modified: 2010-04-09
What is the HTML tags or procedure to have your browser open a new Window when a
page is loaded or a link is clicked?
Where do I place this tag?
0
Comment
Question by:Protorian1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
vendrig earned 10 total points
ID: 1844937
The JavaScript procedure is
window.open("page.html", "MyNewWindow")
To open a window when a page is loaded, simply put it in the body tag:
<BODY onLoad='window.open("page.html", "MyNewWindow")'>
To open a window when a link is clicked, put it in the relevant anchor:
<a href="page1.html" onClick='window.open("page2.html", "MyNewWindow")'>blabla</a>
Note the use of single and double quotes.
0
 
LVL 28

Expert Comment

by:sybe
ID: 1844938
It can be done using only HTML, no javascript needed:

<a href="newpage.htm" target="newwindow">open this in a new window</a>

It will open a new window when the name "newwindow" is not yet in use for a frame or window.

0
 
LVL 2

Expert Comment

by:vendrig
ID: 1844939
Yep, sybe.
Note that the JavaScript procedures have other effects though.
Use the scripts if you need to load more than one page at the time,
otherwise the target attribute is sufficient.
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question