placing controls on Iframe.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sandyuhd

    placing controls on Iframe.


    HI,
    i'm creating acomposite web control.
    for this i'm using iframe as dropdown.
    Through javascript i'm creating iframe onthe page.
    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.
    can somebody help me out

    thanx
    sandyuhd

  • Thomas 'PointedEars' Lahn

    #2
    Re: placing controls on Iframe.

    sandyuhd wrote:
    [color=blue]
    > i'm creating acomposite web control.
    > for this i'm using iframe as dropdown.[/color]

    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.
    [color=blue]
    > Through javascript i'm creating iframe onthe page.[/color]

    Which does not mean that you have to use it for the dropdown control.
    [color=blue]
    > 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.[/color]

    Provided that the target iframe document is located on the same
    second-level domain than the source document:

    /**
    * @author
    * (C) 2003, 2004 Thomas Lahn <types.js@Po intedEars.de&gt ;
    * @optional Object o
    * Object to be determined an method, i.e. a
    * <code>Functio n</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.appendCh ild(textbox);
    }
    [color=blue]
    > can somebody help me out[/color]

    Yes.


    PointedEars

    Comment

    Working...