473,396 Members | 1,693 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,396 software developers and data experts.

Focusing in Firefox and Safari? (window.focus())

Is it possible to focus a window in firefox and safari??

i have a webpage that opens another window, it then focuses on the original window (the new window that opened now behind it in the background). In IE it works fine but in firefox and safari it doesn't focus on the original page. I have looked on all sorts of forums etc and apparently FF and Safari block script that uses window.focus(); So just wondering if there is another way to focus it. [i have tried this.window.focus(), this.focus() and self.focus()]

Any help would be appreciated. Thankyou in advance.
Oct 25 '07 #1
3 17892
acoder
16,027 Expert Mod 8TB
Try focusing from the child window by using window.opener.focus().
Nov 5 '07 #2
if you find the code snippet:

<body onload="self.focus()">

not work in Firefox 2.0 and above, this is not a bug. Firefox has an advanced Javascript option called “Raise or lower windows” which is deactivated by default. You may find this option under:

* Tools
* Options…
* Content tab
* Advanced button next to “Enable JavaScript”
* check the box named "Raise or Lower Windows"



Once enabled the above code will work again. ;-)
Nov 16 '07 #3
acoder
16,027 Expert Mod 8TB
Thanks for the tip. This is also discussed here.
Nov 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing...
5
by: Wei | last post by:
I need the current window stay on focus. The user will have to click on exit button to exit the window. How can I do this in asp.net in C#? Thank you
2
by: Wei | last post by:
I need the current window stay on focus. The user will have to click on exit button to exit the window. When I use the following code, I got an error: "Not implemented" Code: private void...
4
by: badaczewski | last post by:
The following javascript appears on a popup window. <script language="javascript" type="text/javascript"> function InsertContact(value) { window.opener.CallBackContact(value); window.close();...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
3
by: Gandalf | last post by:
does some one know whay this code doesn't works with mozilla: <body onload=\"window.focus();\"> how can i focus this window in both explorer and mozilla browsers? thanks
4
by: Spizzat2 | last post by:
I'm trying to figure out a workaround to a minor annoyance that I'm coming up with while coding a site. I've got some keyboard shortcuts set up for the site via javascript, and when I press escape,...
3
omerbutt
by: omerbutt | last post by:
hi i am using this code to open a new window in firefox but it opens a new TAB every time i want a new WINDOW else than a new TAB. thanks for any help in advance regards, omer. .js file ...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...
0
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...
0
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,...

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.