window.location opens the link in a new window

Discussion in 'Internet Explorer' started by Venkat, Oct 9, 2006.

  1. Venkat

    Venkat Guest


    I am using the following script to open a URL in the same window.

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html">
    <script LANGUAGE="JavaScript">
    function UrlRedirect()
    { this.location.href =
    ("http://localhost/Test2/Default.asp?fromShortcut=yes"); }
    <BODY BGCOLOR="#FFFFFF" text="#c0c0c0" topmargin="0" onload="UrlRedirect()">

    I have created a short cut menu for this file say Redirect.html, When user
    clicks on short cut this page opens and redirects to Test2/default.asp in the
    same window. This was working in IE 6.0 and in IE7.0 in all the Operating
    Systems except on Vista RC1.
    I have tried the following script also and facing the same problem
    <meta http-equiv="refresh" content="0; URL=">
    <meta name="keywords" content="automatic redirection">
    I have tried the following script too and this also opens in a new window
    instead of the same window
    <title>Test 3</title>
    <script language="javascript" type="text/javascript">
    // -->
    Please let me know how can I modify the script to open the redirected URL in
    the same window & tab. The above behavior i sobserved in Vista RC 2 with IE
    7.0.5744.16384. The same behavior is also observed in Vista RC1 with IE 7+
    Thanks in advance
    Venkat, Oct 9, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.