473,779 Members | 2,058 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 5517
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
5394
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
9120
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
2688
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
10306
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
10138
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...
0
8961
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
7485
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
5373
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
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.