Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts

    external site via an iframe

    Hey All,
    I'm attempting to talk to an external site via an iframe and i'm running into problems.

    The site i'm attempting to talk to is on my local network, and i do have permissions to access it so there is no security risk involved.

    My problem is accessing a javascript call on a framed page that exists in my iframe.

    Example:

    Document
    > Iframe
    > Document
    >Frameset (named 'top')
    >Frameset (named 'content')

    I want to talk to content and execute a javascript call.

    I've attempted document.frames['iframe'].frames['content'].javaScriptCall()
    and all other veriations of called a frame/object i can think of. Is there anything i could possibly try or am obviously missing to do this?

    Other examples (there were MANY):
    document.getElementById('iframe').frames[1].call();
    document.getElementById('iframe').document.frames['content'].call();
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    are you sure that:
    frames['iframe'].frames exists?

    I'm not sure myself, and I don't have time to test it, but try alerting each step of your reference chain: alert(document.frames['iframe']); alert(document.frames['iframe'].frames);, etc. and see if you get a null reference.

  • #3
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.frames['iframe'].frames is not null but returns a length of 1
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<

  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    you could try a for (x in frames['iframe'].frames])

    and alert what's in there.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    My problem is accessing a javascript call on a framed page that exists in my iframe.
    document.getElementById('iframeid').contentWindow.frames['framename'].javaScriptCall()

    should do the job, i guess
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kor
    document.getElementById('iframeid').contentWindow.frames['framename'].javaScriptCall()

    should do the job, i guess
    thanks
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •