473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

javascript:window.open question

1.) i want to open a browser when click a button

the browser can only be open ONE only, no TWO can be open!
Feb 22 '06 #1
4 1108
var isOpen = false;
function openWindow()
{
window.open(...);
isOpen = true;
}

you can then place some code in the onUnload of the popup that'll set the
parent's "isOpen" to false on close :)

Karl

--
http://www.openmymind.net/

"Fowler" <Fo****@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
1.) i want to open a browser when click a button

the browser can only be open ONE only, no TWO can be open!

Feb 22 '06 #2
- or consider assigning a name to the windows - it will basically do the
same

window.open("http://foo.com/", "myWindow");

R-)

Feb 22 '06 #3
Hi,

Karl Seguin [MVP] wrote:
var isOpen = false;
function openWindow()
{
window.open(...);
isOpen = true;
}

you can then place some code in the onUnload of the popup that'll set the
parent's "isOpen" to false on close :)

Karl


Why not use the window handle instead?

var theWindow = null;

function openWindow()
{
theWindow = window.open( ... );
}

then:

if ( theWindow
&& !theWindow.closed )
{
theWindow.close();
theWindow = null;
}
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 22 '06 #4
good thinking :)

you can also close()the window and access the closed boolean property.

karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Laurent Bugnion" <lb******@bluewin.ch> wrote in message
news:43**********@news.bluewin.ch...
Hi,

Karl Seguin [MVP] wrote:
var isOpen = false;
function openWindow()
{
window.open(...);
isOpen = true;
}

you can then place some code in the onUnload of the popup that'll set the
parent's "isOpen" to false on close :)

Karl


Why not use the window handle instead?

var theWindow = null;

function openWindow()
{
theWindow = window.open( ... );
}

then:

if ( theWindow
&& !theWindow.closed )
{
theWindow.close();
theWindow = null;
}
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Feb 22 '06 #5

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

Similar topics

1
by: David | last post by:
Hi, I use the following code to open a javascript window. Is it possible to modify this to have the standard toolbar open in the window? Thanks <script language="JavaScript"...
19
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site....
5
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...
1
by: bbcrock | last post by:
Is it possible to send attributes into this function to change the print preferences from Portrait to Landscape with IE 6.0 set as the standard browser? Right now I'm using ...
4
by: Joey | last post by:
I am going to use a collection of either div HTML server controls or panel web server controls (renders as div on newer browsers) on a web form. I need to be able to hide them with a client-side...
1
by: DaniltonW | last post by:
I am trying to create a code for add a page to the favorite but "AddFavorite" not appears in the following function: javascript: window. external. AddFavorite? In javascript:window.external. does...
5
by: zzapper | last post by:
Hi, I use a JavaScript window to access a library of songs when the user picks one this is written to the users database record (PHP/MySQL). When the use closes the JavaScript window he returns to...
3
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I have the following in my asp .net web page. It opens a separate browser window. However, on the main page, all of the contents is gone and shows nothing but . I have to use the Back...
1
gchq
by: gchq | last post by:
Hi there I have a Table nested in a Div that in turn is nested in panel (with scrollbars) in turn nested in a multiview.. The table has the class set as 'print' - that points to a css file via...
5
by: gvamohan | last post by:
hai every one iam opening an window through javascript <script type="text/javascript" language="javascript"> var k=false; ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.