Results 1 to 2 of 2

Thread: adding target=_main

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    75

    adding target=_main

    Hi

    i wrote a code like this:

    var text=document.form1.T1.value

    document.location.href="http:///www.blabla/search?fr="+text

    the link is open in a other window. i want to open in the main window.

    generaly i put target=_main.
    but in here it's making error.

    what the solution plz??
    thanks

  2. #2
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: adding target=_main

    hi,

    if you want to open in the same window then use document.location.href or location.href.
    if you want to open in the parent window then use document.parent.location.href = ""., if the subwindow is opened from main.

    if you specifically want to open in a window then you have to use window.open(). its window.open(url, windowname, [options]). ex., window.open("www.test123.com", "Test_Window");

    so in your case i think window.open will help. you have to give the main windows name in the window.open().
    --Kishore...

Posting Permissions

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



Click Here to Expand Forum to Full Width