473,721 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi-function self close question

I used javascript to open a new window, then used the following to close the
new window on the next click:
<body onBlur="self.cl ose()" onClick="self.c lose()" bgcolor="#FFFFF F">

On the new window I want to place a link to another website, and I want the
new window to open the link in ANOTHER new window (not the parent window)
and then self close.

The idea is that on the first new window I have a picture, and a link to
another website that shows more information about the picture. If the person
just wants to see the picture and go back to my original page, the popup
window disappears. Or if they want more information they click on the link,
and another window pops up and the first popup window disappears. That way
they can look at the new page on someone else's website, and my website page
is still there for them to go back to.

Can I edit the <body> line I used to self close after opening a new window?
I don't want the link to open in the parent window...

Any suggestions?

Thanks,
Ray
Jul 23 '05 #1
4 2009
On Fri, 13 Aug 2004 06:00:31 GMT, Raymond Wilk <rr****@worldne t.att.net>
wrote:
I used javascript to open a new window, then used the following toclose
the new window on the next click:
<body onBlur="self.cl ose()" onClick="self.c lose()" bgcolor="#FFFFF F">
My first piece of advice is to not do that. There are many reasons why a
window might be sent to the background, and I don't think any of them mean
that the window should close. I frequently shift between page tabs on my
browser, and even external applications. That's what a multi-tasking
environment is supposed to allow. I do not expect to come back and find
that what I was looking gone.

[snip]
Can I edit the <body> line I used to self close after opening a new
window?
I don't want the link to open in the parent window...


That, frankly, doesn't make much sense. I assume you mean, "How do I
modify the <body> line to open a new window, then close the current
window?" If so, call openThenClose() , below:

function openThenClose() {
window.open('th eURL','windowNa me');
window.close();
}

If that isn't what you want, please rephrase your question.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail
Jul 23 '05 #2
> That, frankly, doesn't make much sense. I assume you mean, "How do I
modify the <body> line to open a new window, then close the current
window?" If so, call openThenClose() , below:

function openThenClose() {
window.open('th eURL','windowNa me');
window.close();
}

If that isn't what you want, please rephrase your question.

Mike


I got that to work, but I'm missing one function I didn't make clear. If the
link in the window is NOT clicked I would like the window to close.

After following your advice, I have a window that contains a picture and a
link to another site. If the link is clicked, the first window closes and a
new window opens showing the other site. Perfect. But if the person viewing
the first window just wants to look at my picture and NOT follow the link, I
would like that window to self close on the next click.

If I use <body onBlur="self.cl ose()" onClick="self.c lose()"> or just <body
onBlur="self.cl ose()"> it over-rides what you gave me, and closes the window
when the link is clicked.

Thanks for helping me, Mike. I'm a graphics guy and all I know how to do
with scripts is copy-paste!
Ray
Jul 23 '05 #3
On Sun, 15 Aug 2004 06:33:51 GMT, Raymond Wilk <rr****@worldne t.att.net>
wrote:
[snip]
After following your advice, I have a window that contains apicture and
a link to another site. If the link is clicked, thefirst window closes
and a new window opens showing the other site.Perfect. But if the person
viewing the first window just wants tolook at my picture and NOT follow
the link, I would like thatwindow to self close on the next click.
So,

1) User clicks on link in main website. This opens new window with
image a link.
2a) User clicks link in new window. Second window opens containing web
page at URL. First window closes.
2b) User clicks elsewhere in page. First window closes, leaving
original site.

That correct? If so, try:

In first window:

<head>
<title>...</title>

<style type="text/css">
body {
bottom: 0;
position: absolute;
top: 0;
}
</style>
</head>

<!-- I still recommend not using onblur="self.cl ose()" -->
<body onclick="self.c lose()">
<!-- image -->
<!-- A button would be better than a link... -->
<a href="#" onclick="window .open('url','na me');return false;"...</a>

</body>

That does what I've listed above. The style sheet is a kludge to ensure
that Opera (and possibly other browsers) register the body click anywhere
on the page. Without it, the body only extends as far as the last element.

If this *still* isn't correct, I apologise for being so dense. :)

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail
Jul 23 '05 #4
> If this *still* isn't correct, I apologise for being so dense. :)

Michael Winter


That's exactly what I'm looking for! Thanks again for the help!
Ray
Jul 23 '05 #5

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

Similar topics

37
4891
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo
4
4669
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
3877
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
0
3780
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black and white CCITT4 compressed files (frames) inside the tiff. Every now and then I receive a mixture of black and white CCITT4 and JPEG compressed files, and sometimes just multi-page tiffs with JPEG only. The code runs great when dealing with the...
6
8172
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
6
4892
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on a table called COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME. The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES. I want to populate the course list box based on any category(s)
4
17871
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the problem is the charset? How I can avoid this warning? But the worst thing isn't the warning, but that the program doesn't work! The program execute all other operations well, but it don't print the converted letters: for example, in the string...
5
5992
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a TIFF to several PNG files this causes a problem, becuase the resulting image is (the page to the far left and a lot of black space surrounding it and a filesize that is larger than needed. Any ideas?
5
3282
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify this? Private Sub cmdPreview_Click() On Error GoTo Err_Handler 'Purpose: Open the report filtered to the items selected in the list box. 'Author: Allen J Browne, 2004. http://allenbrowne.com Dim varItem As Variant 'Selected items
0
2327
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing Systems (MuCoCoS'08) Barcelona, Spain, March 4 - 7, 2008; in conjunction with CISIS'08. <http://www.par.univie.ac.at/~pllana/mucocos08> *********************************************************************** Context
0
8840
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
8730
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
9215
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
9131
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
8007
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
6669
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
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
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.