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

    Oct 29, 2006
    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.
    <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.:

    <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


    Jul 24, 2006
    The Ivory Tower (I'm not coming down)
    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


    Staff Member

    Dec 7, 2002
    New Zealand
    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