views:

11

answers:

1

How to give focus to an iFrame in firefox just page is loaded?

FYI: I tried focus() javascript & jQuery functions to do this, works properly for XP, but doesn't work for Windows 7?
Also, how does foucs() functionality differs from platform to another one?

+1  A: 

try to trigger the focus or focusin event on page/dom ready.

$(document).ready(function(){
  $('iframe').trigger('focusin');
});
jAndy
It doesn't work.
Ahmed
The focusin event is sent to an element when it, or any element inside of it, gains focus.What I need to give focus to iFrame, while page is loaded.
Ahmed