Solved

New Page

Posted on 1998-07-28
3
144 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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
vendrig earned 10 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now