473,395 Members | 2,689 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,395 software developers and data experts.

self.focus() not working in Opera?

WH
I put this line in HTML
<body bgcolor="#FFFFFF" onLoad="focus()">

Both Mozzila and IE can do self.focus(). However Opera still does not take
the focus().
Jul 23 '05 #1
1 2330
WH <ke***@whitehouse.gov> wrote:
^^^^^^^^^^^^^^
You really want to refrain from spoiling namespaces
and from using a faked From/Reply-To address, see

<http://na.edit.client.yahoo.com/rogers/show_static?.form=eua>
<http://www.hispeed.rogers.com/yahoo/info/eua.jsp>
I put this line in HTML
<body bgcolor="#FFFFFF" onLoad="focus()">
Do not use the "bgcolor" attribute without the "text", "link", "alink" and
"vlink" attributes, and, even better, use CSS instead of deprecated format
attributes.
Both Mozzila
What?
and IE can do self.focus().
But you cannot be sure that you call self.focus() here.
However Opera still does not take the focus().


Does the JavaScript Console show error messages?

Without an object reference in an intrinsic event handler attribute value,
the scope chain is followed, so it could be that Opera interprets `focus'
as `document.focus', not `window.focus' == `self.focus'. That's also why
it is bad to write only `open(...)' within an event handler attribute value
as both the object referenced by `window' and the object referenced by
`document' have an open() method according to DOM Level 0 (for `window')
and DOM Level 0+ (for `document').

It could as well be that the DOM of the Opera version(s) you have been
testing with does not support Window.focus(). This method is part of
the proprietary DOM Level 0, it can be supported by a standards compliant
UA but does not need not to.

But why would someone want to focus the window containing the currently
loaded document, even if that worked?
PointedEars
--
Never learn by your misstakes, if you do you may never dare to try again...
Jul 23 '05 #2

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

Similar topics

4
by: Stephen Poley | last post by:
The issue of the focus pseudo-class came up a few weeks ago, and I finally got around to trying it out (better late than never ...) The recommended order given for the pseudo-classes is link,...
7
by: WH | last post by:
<html> <head> <style type="text/css"> html, body { overflow: hidden; } </style> </head> <body onload="showit()" leftMargin="0" rightMargin="0" topMargin="0"
14
by: Mark | last post by:
Hi, At the top of my php file I have got :- <body onblur="self.focus();"> so when I click off onto another window, my window comes back up in front which is perfect. The problem however, is...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...

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.