sandyuhd said:
i'm creating acomposite web control.
for this i'm using iframe as dropdown.
Of all the block elements that could be (ab)used for a dropdown control
(without Clean Degradation, though), the `iframe' element appears to me
the least suited. Use a `div' element if you have to, use a `select'
element for Clean Degradation.
Through javascript i'm creating iframe onthe page.
Which does not mean that you have to use it for the dropdown control.
and ihave to display labels and textboxesin the iframe which will have
the data .
my question is how to create labels and textboxes on an iframe.
Provided that the target iframe document is located on the same
second-level domain than the source document:
/**
* @author
* (C) 2003, 2004 Thomas Lahn <
[email protected]>
* @optional Object o
* Object to be determined an method, i.e. a
* <code>Function</code> object assigned as property of
* another object. May also be a string to be evaluated
* and so is applicable to unknown properties.
* @return type boolean
* <code>true</code> if <code>o</code> is a method,
* <code>false</code> otherwise.
* @see #isMethodType()
*/
function isMethod(m)
{
var t;
(m = eval(m)) && (t = typeof m);
return (t == "function" || t == "object");
}
// Only if sub-level domains differ, see Same Origin Policy
document.domain = "my-second-level-do.main";
var
f,
d = (f = frames['myIFrame']) && f.document,
b,
textbox;
if (d
&& (b = d.body)
&& isMethodType("b.appendChild")
&& isMethodType("d.createElement")
&& ((textbox = d.createElement('input')))
{
d.body.appendChild(textbox);
}
Yes.
PointedEars