473,790 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript:clos e() for tab in Firefox

I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
I have tried opener.focus() with no effect.

I can't tell what is running. It doesn't happen with IE.

Any explanation/solution?

Ron Lowe
Jun 27 '08 #1
13 5519
pe**********@gm ail.com schreef:
I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
I have tried opener.focus() with no effect.
That is no valid eventhandler.
It is pseudoprotocol for <a href="javascrip t:...">
Never use it.

To get your onload handler working simply use:
<body onLoad="someFun ction();">

and define someFunction() elsewhere.
You can also put the direct javascript commands into the onLoad handler.

>
I can't tell what is running. It doesn't happen with IE.
IE sucks in its own way.
>
Any explanation/solution?

Ron Lowe
Regards,
Erwin Moller

Jun 27 '08 #2
SAM
pe**********@gm ail.com a écrit :
I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
<body onload="self.cl ose();">

What is the interest to load a page if it is to close it immediately ?

<body onload="setTime out(self.close, 200);">

Usually when the pop-up-tab is closed you come back to the opener tab.
There is no reason to get egg-timer nor wheel

What does the error console of Fx say ?
I have tried opener.focus() with no effect.
too late ?
Any explanation/solution?
what is supposed the "separate" php to do ?
can't it close the window (tab) itself ?
(instead of onload in body tag)
in opener try with your link :

<a href="page.php" target="other" onmouseup="this .blur();">
<a href="page.php"
onclick="window .open(this.href );this.blur();r eturn false;">
and don't forget ............... ............... ^^^^^^^^^^^^^

--
sm
Jun 27 '08 #3
Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
pe**********@gm ail.com schreef:
>I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
I have tried opener.focus() with no effect.

That is no valid eventhandler.
yes it is. in this case, javascript: is interpreted as a label. it's
just useless.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Jun 27 '08 #4
Joost Diepenmaat schreef:
Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
>pe**********@gm ail.com schreef:
>>I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
I have tried opener.focus() with no effect.
That is no valid eventhandler.

yes it is. in this case, javascript: is interpreted as a label. it's
just useless.
Hi,

OK, thanks for correcting that. I didn't know that.

Is there ANY use ever for javascript: ??
(I don't want to advise people to avoid it if it has actual use
somewhere/somehow.)

Regards,
Erwin Moller

Jun 27 '08 #5
Joost Diepenmaat wrote:
Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
>pe**********@gm ail.com schreef:
>>I am writing a PHP/MySQL web-page based system on Firefox and wish to
run a separate page from an <Alink to run a separate PHP script,
then close that page. Firefox starts a new tab for this and it closes
OK but I am then left with an egg-timer at the mouse arrow when over
top or bottom toolbars areas of the parent page.

I am using <BODY onLoad='Javascr ipt:close()'to fire the tab closure.
I have tried opener.focus() with no effect.
That is no valid eventhandler.

yes it is. in this case, javascript: is interpreted as a label. it's
just useless.
To be precise, it is not an event handler, valid or otherwise. It is the
value of an intrinsic *event handler attribute*. The value, which type is
CDATA, is supposed to be a string value representing code written in an
ECMAScript implementation here (because such a language appears to be the
default scripting language in past and current HTML UAs).

Whether `javascript:' constitutes syntactically valid ECMAScript-compliant
code depends on the implementation used: ECMAScript before Edition 3 did not
specify the LabelStatement production. So strictly speaking, it is e.g. not
valid (by any standards you want to apply) in Netscape before version 4.0,
and Microsoft Internet Explorer before version 4.0, because the ECMAScript
implementations they supported did not support that particular feature yet.

http://PointedEars.de/scripts/es-matrix/#javascript
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 27 '08 #6
Erwin Moller wrote on 14 mei 2008 in comp.lang.javas cript:
Is there ANY use ever for javascript: ??
(I don't want to advise people to avoid it if it has actual use
somewhere/somehow.)
Yes.

1 In favelets/bookmarklets.

2 In an [IE only] vbscript using page, to call sporadic js:

=============== =========
<script type='text/vbscript'>
document.write "Hello<br>"
i = 7
</script>

<div onclick = 'javascript:ale rt(++i);'>
Click me!
</div>
=============== =========

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 27 '08 #7
Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
Is there ANY use ever for javascript: ??
(I don't want to advise people to avoid it if it has actual use
somewhere/somehow.)
IIRC the purpose of the javascript: URLs (and URLs only) is to call a
JS function that returns the content of a page/image/whatever. IOW you
could use it to generate an image or page on the fly. Which won't work
for event handlers, since event attribute values aren't URLs.

For instance: <a href="javascrip t:'bla'">click</a>

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Jun 27 '08 #8
Joost Diepenmaat <jo***@zeekat.n lwrites:
Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
>Is there ANY use ever for javascript: ??
(I don't want to advise people to avoid it if it has actual use
somewhere/somehow.)

IIRC the purpose of the javascript: URLs (and URLs only) is to call a
JS function
^^^^^^^^ or direct code. it seems to work more or less like eval()
in that regard...
that returns the content of a page/image/whatever. IOW you
could use it to generate an image or page on the fly. Which won't work
for event handlers, since event attribute values aren't URLs.

For instance: <a href="javascrip t:'bla'">click</a>
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Jun 27 '08 #9
Joost Diepenmaat wrote:
Joost Diepenmaat <jo***@zeekat.n lwrites:
>Erwin Moller <Si************ *************** *************** @spamyourself.c omwrites:
>>Is there ANY use ever for javascript: ??
(I don't want to advise people to avoid it if it has actual use
somewhere/somehow.)
IIRC the purpose of the javascript: URLs (and URLs only) is to call a
JS function
^^^^^^^^ or direct code. it seems to work more or less like eval()
in that regard...
It is described how it is supposed to work, and that appears to match the
implementations ' behavior. I have posted the description in another thread
*today*, so there really is no need to post your wild assumptions.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jun 27 '08 #10

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

Similar topics

4
3695
by: Dave Blair | last post by:
Hi, I have a problem with our intranet, we are planning to install Firefox instead of Internet Explorer onto some new PCs. However, we can't get the following JavaScript to work in Firefox and similar code is used in lots of the intranet stuff. The code should bring up a message box with a warning and not allow the user to continue unless they have filled in the entry in an html form (the form is called 'myauthor').
4
3638
by: nec | last post by:
Hi, I'm having trouble calling a function thats located in a iFrame from the parent. Shortly, i can't figure out the location in DOM. In IE it works fine with a simple line of window.contens.alerter('wassa?'), but it doesnt, of course work in Firefox (0.8). I've tried document.getElementById('contens').alerter('wassa?') and
4
5668
by: Colin Graham | last post by:
Hi guys, Just a quickie here that i hope someone can help me with. Basically i want stop the user from closing the popup window using the small x button in the top right hand corner. Im aware that i cant disable this so i thought is it possible to do a check to see if a hidden text on the main form has a value. E.g. if we close the popup correctly then text box on the main form will say true. If we close the text box using the x in the...
10
5395
by: andreister | last post by:
He there! I've discovered that the ================================================= document.links('link_id_here').href = "something"; ================================================= is not applicable for the Firefox (even for the 1.0.6), and I'm falling into passing through the array and checking each link id.
0
3223
by: Ashok | last post by:
I have developed a custom IE application in C# using webbrowser control. But i am facing couple of issues when user clicks on an Exit link on a page the application is getting grayed out, but not closing. I exposed a close button in my application for doing this (this. Close (); ), but the end user wants the client JavaScript also ("Exit") to work. Is there any way to do this? What I have to do to make the JavaScript to work in my...
1
1998
by: luckyroom505 | last post by:
Hello to you all. I am trying to use an already installed dll on a Windows machine. I use javascript, and the OBJECT tag. On Internet Explorer this works fine, but on Firefox (v1.04) not. This is obviously because FF does not support ActiveX. There is the FF ActiveX extension:
3
9121
by: adbo_atoz | last post by:
Hello All I am trying to duplicate this code which works in IE to work in Firefox <SCRIPT LANGUAGE="javascript"> function submitOnEnterKey() { if(event.keyCode == 13) { event.returnValue = false; } else { event.cancelBubble = true
1
1819
by: Yeezy | last post by:
Hi, I have the following javascript in my .aspx page where it will redirect you to another new .apsx. However, I have no problem with it when running on IE.. But when it's run with firefox, the script got hang with the words "Loading" and never get redirect to the new .aspx. Any ideas where went wrong? Kindly please advise. Thanks. <script type="text/javascript" language="javascript"> function NewButtonClicked() { ...
5
2690
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written works fine in IE7 and beta IE8. My pages do not work however in Safari or Firefox, and please dont beat me, but i use Frontpage to write my site, and i use iframes as ive not discovered how to do this any differently! So the issue is this, i have a...
0
9666
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
9512
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
10413
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
10200
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
10145
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
9986
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
6769
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
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.