onLoad="window.location.href='page2.html';" not working

Discussion in 'iPhone/iPad Programming' started by Danneman101, Oct 28, 2009.

  1. macrumors 6502

    Joined:
    Aug 14, 2008
    #1
    Ive got a webview which loads a local html.

    From that html I can easily navigate to another html via the <a href>-tag.

    Code:
    <a href="page2.html">go to page2</a>
    
    But surprisingly I cant use javascript to navigate between the two html's.

    Code:
    <body onLoad="window.location.href='page2.html';>
    
    This code will not go to page2.html on load.

    Any ideas why, and how I can get around this?

    Thanks,
    Daniel
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2
    Code:
    <body onLoad="window.location.href='page2.html';[B][COLOR="Red"]"[/COLOR][/B]>
     
  3. thread starter macrumors 6502

    Joined:
    Aug 14, 2008
    #3
    Sorry - that was only a typo when transferring it to the forum. Still not working :/
     

Share This Page