473,803 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help on openning a new window

Hi, I want to open a new window without tool bar, address bar and status bar.
then inside the page, there are a few links, i want, when clicking a link, a new
window opens, but still without tool bar, address bar and status bar.
My code can open the first new window properly, but it cannot open the second
one at all. Could anyone please help me?

function popOpen(url,nam e,attributes) {
windowHandle = window.open(esc ape(url),name,s crollbars = 1,"'left=20,top =20");
}
Jul 23 '05 #1
3 2981
Hi Yaqian,

Does the url of the second page also have function popOpen so that you
can open a second page?
If yes, then did you check to see that the function is called
correctly?

Jul 23 '05 #2
"Yaqian" <y.****@uq.edu. au> wrote in message
news:d9******** ***@bunyip2.cc. uq.edu.au...
Hi, I want to open a new window without tool bar, address bar and
status bar.
then inside the page, there are a few links, i want, when clicking a
link, a new
window opens, but still without tool bar, address bar and status bar.
My code can open the first new window properly, but it cannot open the
second
one at all. Could anyone please help me?

function popOpen(url,nam e,attributes) {
windowHandle = window.open(esc ape(url),name,s crollbars =
1,"'left=20,top =20");
}


The third parameter of window.open() is a comma-separated string of
attributes:

window.open(url , name, "scrollbars=1,l eft=20,top=20") ;

You do not need to, nor should you, escape the URL... if there is query
string content that needs to be URI encoded, that should be done before
passing the url to your popOpen() function, or pass the query string
name/value pairs as object property/values so you can escape (not really
encodeURI(), but it will have to do if you want to support user agents
which don't support encodeURI()) each query value as it is appended to
the url:

function popOpen(url, queryPairs, name, attributes) {
var queryString = [];
for (var queryPair in queryPairs) {
// escape() could be encodeURI() if you
// can guarantee it will be available
queryString.pus h(queryPair + '=' +
escape(queryPai rs[queryPair]);
}
w = window.open(
url + (queryString.le ngth > 0 ? '?' + queryString.joi n('&')
: ''),
name,
attributes
);
}

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #3
Grant Wagner a écrit :
"Yaqian" <y.****@uq.edu. au> wrote in message
news:d9******** ***@bunyip2.cc. uq.edu.au...
Hi, I want to open a new window without tool bar, address bar and
status bar.
then inside the page, there are a few links, i want, when clicking a
link, a new
window opens, but still without tool bar, address bar and status bar.
My code can open the first new window properly, but it cannot open the
second
one at all. Could anyone please help me?

function popOpen(url,nam e,attributes) {
windowHandl e = window.open(esc ape(url),name,s crollbars =
1,"'left=20,t op=20");
}

The third parameter of window.open() is a comma-separated string of
attributes:

window.open(url , name, "scrollbars=1,l eft=20,top=20") ;

You do not need to, nor should you, escape the URL... if there is query
string content that needs to be URI encoded, that should be done before
passing the url to your popOpen() function, or pass the query string
name/value pairs as object property/values so you can escape (not really
encodeURI(), but it will have to do if you want to support user agents
which don't support encodeURI()) each query value as it is appended to
the url:

function popOpen(url, queryPairs, name, attributes) {
var queryString = [];
for (var queryPair in queryPairs) {
// escape() could be encodeURI() if you
// can guarantee it will be available
queryString.pus h(queryPair + '=' +
escape(queryPai rs[queryPair]);
}
w = window.open(
url + (queryString.le ngth > 0 ? '?' + queryString.joi n('&')


Shouldn't that be '&amp;' instead of '&'?
Just asking.
: ''),
name,
attributes
);
}


Gérard
--
remove blah to email me
Aug 19 '05 #4

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

Similar topics

3
1589
by: Fang | last post by:
Hi, I'm using the following code to open a new window in specified size, and I don't want it to be located at the default position. Strangely, seems only "top" can work. Could anyone please help me out? <script language="jscript"> /* Open window*/ var windowHandle = ''; function popOpen(url,name,attributes) { // windowHandle = window.open(url +escape(url),name,attributes); windowHandle =
5
4698
by: Tedmond | last post by:
Dear all, How can I get all the titles of all openning windows? I found a API in win32 that called EnumWindows() but it returns only the windows handles, not titles. How can I get the list just like the Applications tab in Windows Task Manager? Thanks, Tedmond
4
5671
by: Ohad Young | last post by:
Hi, I need to open (launch) an external application from my winform application. The application is not a dot.net application, for example the windows calculator. I'm using the System.Diagnostics.Process class, for example: .... System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false;
4
1397
by: HVG | last post by:
Hi, is it possible to render a whole page (ie. a aspx webform) to a string _without_ actually loading the page in a window? Eg if Iam executing page1.aspx at the server, I would then like to render page2.aspx to a string _without_ returning to the client. I currently happily override the Render property of a page and capture its html that way, but so far this requires me to postback to the client and open the page in a little window,...
2
1212
by: HVG | last post by:
My previous post on this didnt quite find a solution, so can we try again please? My senario is that from the codebehind in "page1.aspx", I wish to render "page2.aspx" (ie. a totally a different page) to html. I'm after something like: ... dim p2 as new Page(page2.aspx) ' <--- how to do this? p2.RenderControl(htmlWriter);
2
1137
by: Eitan | last post by:
Hello, I want open a new page (on the same window), by using some vb script (I am in aspx file). How can I do that ? Thanks :)
1
1497
by: tshad | last post by:
I have a situation where I could Try Open a Connection ExecuteReader Close Reader Catch may not happen - Possible if this a Timer in a Windows Service
9
4184
by: bj19138 | last post by:
How do you have your browser maximized when openning. When I open my Browser it always is minimized.?
1
1167
by: mahesh123 | last post by:
Hi, I am using the VB6.0 and for report crystal reports 8.0. the reports are not openning(means its openning but immediately it is closed the report) when we installed the reports in other system. I installed all the depends for the reports. The system is 64 bit WinXP which i installed the reports. Regards ------------ Mahesh
0
9700
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
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
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
10292
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
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
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
7603
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
5498
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...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.