Cross Frame plus Option, the following code will be wrong in IE5, but there is no problem in IE4, IE6, Opera6, NNx:
Function addOption (Aselect, optionid, optionname) {
NEWOPTION = New Option (optionname, OptionID);
Aselect.Options [Aselect.Options.Length] = NewOption;
}
script>
This is right:
Function addOption (Aselect, optionid, optionname) {
OwnerWindow = aselect.document.parentwindow;
Ownerwindow.newoption = new option (optionname, optionid);
Aselect.Options [Aselect.Options.Length] = OwnerWindow.NewOption;
}
Function crossframeaddoption () {
VAR ASELECT = Parent.dherframename.document.forms [0] .theselectricalname;
AddOption (Aselect, "ID" Aselect.Options.Length, "Name" Aselectr.Options.Length);
}
script>
Microsoft explained as follows: In general, at least in the older browser versions, performance seems to improve if you call methods on the target frame if they are stored there as well This is particularly relevant when trying to add options to a select box in. ANOTHER FRAME. Make Sure You Create The Option In That Other Frame So You Are Adding It to a local select box, instead of trying to cross frame boundaries.
Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebteam/html/webteam02052002.asp