Ok, I copied this code from the Mozilla developer center but funny enough,
it works under IE6 and not on Firefox:
/**
* First I define the function.
* @param String aID - ID of the iFrame I want to access.
* @return String - the query needed to access the iFrame as appropiate in
W3C or MS mode.
*/
function getIFrameDocument(aID){
if (document.getElementById(aID).contentDocument)
return document.getElementById(aID).contentDocument;
else
return document.frames[aID].document;
}
/** And now I use inside $(document).ready. */
$(document).ready(function(){
console.log(getIFrameDocument("foo").designMode); /** returns "off". */
getIFrameDocument("foo").designMode = "On";
console.log(getIFrameDocument("foo").designMode); /** returns "on". */
});
So it works perfectly in IE6 leaving the iFrame with ID = "foo" with design
mode "on" so you can edit it. In Firefox the console logs the function's
success at changing the mode when actually it is still "off". The function
seems to be well written: if once everything is loaded you type
getIFrameDocument("foo").designMode
= "On" in Firebug, the mode changes effectively, so I'm thinking that this
might be due to an incompatibility with the $(document).ready statement.
Anyone sees anything wrong in the code or has ideas or suggestions? thanks.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/