iframe stealing focus

Hi,

Is there a clean way to have focus retained by a parent page (.asp) when there exists iframed content that is uncontrolled (and trying to steal focus)?

[177 byte] By [LizG] at [2007-12-25]
# 1
Have you tried putting an onfocus event in the IFRAME element?

Example:

<IFRAME src="http://www.yahoo.com" onfocus="window.focus()"></IFRAME>

if that doesnt work, you can add an event handler to the parent window to retain focus.

Example:

<SCRIPT language="Javascript">
window.onblur = function() { window.focus(); }

</SCRIPT>

If you find that the IFRAME still retains focus, you may want to try switching out the window object in these examples with "document.body"

Wagepeace007 at 2007-10-8 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...