Solved

New Page

Posted on 1998-07-28
3
180 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS for <center> 14 49
Hit counters in SharePoint 2013 2 61
PHP Command to Open New Tab/Page using Window.Open 3 33
Display Flex does not Wrap Items 2 46
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.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

738 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