SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript iframe help!

    Ok I have a page with an iframe. On the main page I have a form. Now I want this form to on submit, execute something on the iframe (refresh). However I have different can have different iframe pages. What I need is a way figure out the name or file name of the page inside the iframe and then refresh that page. So it looks something like this:


    window.form.iframename.location = variable + "?method=update";

    any ideas?
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the pages in the IFRAME also within your domain?

    And the best way to set the HREF property of a frame is like this..

    top.frames['iFramesName'].window.location.href = sURL;
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get a permission denied error



    <head>


    <script language="javascript">

    function go()
    {

    top.frames['poop'].window.location.href = "http://www.yahoo.com";


    }


    </script>

    </head>

    <body onload="go()">

    <iframe name="poop" src="http://www.google.com" width=500 height=500 frameborder=2></iframe>
    Free Science Homework Help
    http://www.physicsforums.com

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by beetle
    Are the pages in the IFRAME also within your domain?
    IFRAME (or regular frame) security prevents you from enacting pretty much anything upon the document within the frame if that document is not in the same domain as the document that contains the frame.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





Bookmarks

Posting Permissions

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