iFrame does not work (iFrame destination opens in new window)

Discussion in 'Web Design and Development' started by theprizefight, Oct 29, 2009.

  1. theprizefight macrumors member

    Joined:
    Oct 29, 2006
    #1
    I have a page Im working on, on which I want to use an iframe. I want the iframe to be a login page which is already built and functional.

    If I insert an iframe linking to google, e.g.
    HTML:
    <iframe src="http://www.google.com/" width="100%" height="260px" scrolling="no" /></iframe>
    then it displays just as expected.

    However, if I change the iframe source to that login page, e.g.:

    HTML:
    <iframe src="myLoginPage.aspx" width="100%" height="260px" scrolling="no" /></iframe>
    something strange happens. When I load the page, it appears normally for a brief moment, but then the whole browser page changes to just the iframe source, full screen.

    Since the iframe source page features some javascript, and is in the form .aspx, im wondering if this may be the reason why its acting strange? if thats the case, are there any known hacks to force it to stay in an iframe instead of opening as a new page?

    thanks in advance.
     
  2. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #2
    I don't know the answer to your question, but I'm curious why you're using a frame to begin with. Frames are thankfully being phased out.
     
  3. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #3
    I would temporarily remove the JavaScript from myLoginPage.aspx and see what happens. I've seen the same sort of thing happen before, due to scripts trying to resize the frame.
     

Share This Page