473,804 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FAQ Topic - How do I open a new window with javascript? (2008-03-27)

-----------------------------------------------------------------------
FAQ Topic - How do I open a new window with javascript?
-----------------------------------------------------------------------

New windows can be opened on browsers that support the
` window.open ` function and are not subject to the action of any
pop-up blocking mechanism with code such as:-

if(window.open) {
wRef = window.open("ht tp://example.com/page.html","win dowName");
}

http://developer.mozilla.org/en/docs/DOM:window.open

http://www.infimum.dk/HTML/JSwindows.html
--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javas cript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Mar 27 '08 #1
1 1252
In comp.lang.javas cript message <47************ ***********@new s.sunsite.
dk>, Thu, 27 Mar 2008 00:00:02, FAQ server <ja********@dot internet.be>
posted:
>-----------------------------------------------------------------------
FAQ Topic - How do I open a new window with javascript?
-----------------------------------------------------------------------

New windows can be opened on browsers that support the
` window.open ` function and are not subject to the action of any
pop-up blocking mechanism with code such as:-

if(window.open) {
wRef = window.open("ht tp://example.com/page.html","win dowName");
}

http://developer.mozilla.org/en/docs/DOM:window.open

http://www.infimum.dk/HTML/JSwindows.html

That needs re-thinking and re-writing.

My MS IE 7 is certainly subject to the action of a pop-up blocking
mechanism, yet it can certainly open new windows.

There seems to be four (or more) distinct cases to consider : the first
parameter of window.open can be an empty string (""), or it can be a
relative reference ("sibling.htm") , or it can be a full reference
("http://...") to the same site, or it can be a full reference
("http://...") to a different site.

As a first step, I suggest (note spaces in code, for legibility) :
New windows can be opened on browsers that support the ` window.open `
method with code such as :-

if (window.open)
wRef = window.open(
"http://example.com/page.html", "windowName ", "windowFeatures ")

Opening new windows is often prevented by a pop-up blocker.

--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.co m/CompLangPascalD elphiMisc-MiniFAQ.htmclpd mFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews: borland.* Guidelines
Mar 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3357
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page? The following page2.asp won't output the value entered in page1.asp. However, if we do <form action="page2.asp" method="get" target="_blank">, then it will open a new window for the request page, instead of using the same window as page1.asp....
29
5035
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
3
1637
by: Grey | last post by:
I know I need to use client side script to open new window, window.open("URL"). However, the URL in the function is dinamically generated by server side. How can I open window in client side, but specify the URL in server side.??? Million thanks -- Best Regards,
5
3396
by: Mark | last post by:
Hi all, how do I open a javascript window from a code behind page? I was using Response.Write("<script language='javascript'>window.open('url','name','options');</script>") but now for some reason it is not working.. Thanks in advance Mark
1
3657
by: Alejandro Vidal | last post by:
Hi, I have a curius problem, I hava a flash in a html page. In flash I have a button to open a pop up with this code: getURL ("javascript:void(window.open('http://www.onePage.com','popwindow','status=y es,scrollbars=yes,width=800,height=450,resizable=yes'))"); this works perfect always, but now when the page is inside a frame it doesn't work, doing nothing.
0
1787
by: coosa | last post by:
Dear all, I tried to replace the GridView Column's HyperLinkField "DataNavigateUrlFormatString" property with a java script pop up window, but wehen i preview the page, the link is REMOVED! Does any one see any thing wrong in the code below? <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ITEM_ID" DataSourceID="SqlDataSource1"> <Columns>
4
1813
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Internationalisation in javascript. ----------------------------------------------------------------------- There are but a few Internationalisation features in JavaScript. The various toString() methods are all implementation dependent, but tend to use either UK or US settings. ECMAScript Ed. 3 has introduced some capabilities, including the...
1
1706
by: peerraghu | last post by:
hi i am creating travels project using .net and c# and iam new to java scripts i want to open new window with in the same page after clicking the image i have wreiten code just look at this <script language=javascript> function open_win(url_add) { window.open(url_add,'','width=800,height=650' }
1
7393
mageswar005
by: mageswar005 | last post by:
Hello, In My Application i have open the PDF file from javascript open.window function.In This scenario i want to control / Hide the PDF Toolbar from open.window function. My Current code is given below function poponload(strs) { var path="d:/files/hello.pdf"; testwindow= window.open (""+path+"", "mywindow","location=0,status=0,scrollbars=1,toolbar=no,resizable=yes,width=500,height=500"); testwindow.moveTo(0,0);
1
2460
by: hcoulange | last post by:
I am trying to open a window inside a DIV or a table cell. In the stylesheet I put a #container and a #jx, In my page I have first a div id=container and another DIV call jx the first with position relative the second with position absolute so the second is placed under the container. I want to put my javascript open.window using top left height width according to the user's screen measurements. I use percentage so it is relative easy to...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.