new window focus

G

Gandalf

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
 
T

Thomas 'PointedEars' Lahn

Gandalf said:
because i print it width PHP you can ignore that it's meaningless

It's not. You are forcing PHP to do things it does not have to do, writing
inefficient code. Consider this instead:

<?php
...
?>
<body onload="window.focus();">
<?php
...
?>

That said, never post server-side code when asking a client-side question.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Gandalf said:
does some one know whay this code doesn't works with mozilla:

<body onload=\"window.focus();\">

Ignoring the escapes (you stated it's PHP code), it does not work because
Mozilla is not allowed by the user to make it work. This was discussed
shortly ago.
how can i focus this window in both explorer and mozilla browsers?

You can not. Focusing windows, as many other things, is at the discretion
of the user.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top