Open a page from search frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kojak

    Open a page from search frame

    I have a own search engine in a intranet. It can be opened by the
    search button or with the target="_search ".

    On the page is a Textbox and a button. The page works well, but just
    opens in the wrong frame. I know the frame name I have to use is
    "_main" but I dont know how to use it with Javascript.

    function search( strKey ) {
    var strSearch= document.forms( 0).txtSearch.va lue;
    document ??? .location.href= 'ViewPage.aspx? SrchKey=' + strKey +
    '&SrchString= ' + strSearch ;
    event.returnVal ue = false;
    }

    Thanks for help
    Kojak

  • Robert

    #2
    Re: Open a page from search frame

    Kojak wrote:[color=blue]
    > I have a own search engine in a intranet. It can be opened by the
    > search button or with the target="_search ".
    >
    > On the page is a Textbox and a button. The page works well, but just
    > opens in the wrong frame. I know the frame name I have to use is
    > "_main" but I dont know how to use it with Javascript.[/color]

    window.frames["_main"].location.href = ...

    Comment

    • Kojak

      #3
      Re: Open a page from search frame

      Hm thanks, but it's worse as I thought.

      That's the way I open the Page in the search frame.
      <a href="http://myPage.com/search/left.aspx" target="_search ">Open in
      _SearchFrame</a>

      And I can open a Link in the "_main" frame
      <a href="http://myPage.com/search/index.aspx" target="_main"> Intranet
      Suche _Main</a>

      But I get an error with
      window.frames["main"].location.href= 'NewSearchQuery .aspx'; or
      ...frames["_main" ]....

      Does that

      Comment

      • Robert

        #4
        Re: Open a page from search frame

        Kojak wrote:[color=blue]
        > Hm thanks, but it's worse as I thought.
        >
        > That's the way I open the Page in the search frame.
        > <a href="http://myPage.com/search/left.aspx" target="_search ">Open in
        > _SearchFrame</a>
        >
        > And I can open a Link in the "_main" frame
        > <a href="http://myPage.com/search/index.aspx" target="_main"> Intranet
        > Suche _Main</a>
        >
        > But I get an error with
        > window.frames["main"].location.href= 'NewSearchQuery .aspx'; or
        > ..frames["_main" ]....
        >[/color]

        Well I cannot see from your information which frame is in what other
        frame. Perhaps the _main frame and _search frame are part of one top
        frame? In that case try:
        window.top.fram es["_main"].location.href= ...

        Comment

        • Kojak

          #5
          Re: Open a page from search frame

          My problem is I use the IE Standard Button Search for an own search.
          Insead of MSN comes my search site.
          is like to use a hyperlink with target="_search ". Will open in a
          special frame on the left site. When click a button the request should
          open in the main frame which is called _main, I tried with normal links
          an diffrent target. Only target="_main" opens where I expect it.
          But because I want to open another Page in another frame I have to send
          to another page with a query string. The best way should be javascript,
          but javascript doesn't work with "_main" or "main" I tried the same
          script with top or parent and is no problem, except that they opens in
          the wrong frame :-(


          <input type="submit" name="btnSearch " value="Go" id="btnSearch"
          onClick="javasc ript:search( );" />

          <script language="javas cript">
          <!--
          function search( ) {
          var strSearch= document.forms( 0).txtSearch.va lue;
          window.frames["_main"].location.href= 'SearchQuery.as px?SrchString=' +
          strSearch ;
          }
          //-->

          maybe there is a javascript for the activ window or something?

          Comment

          • Kojak

            #6
            Re: Open a page from search frame

            It's ok now, I found a solution, it works with open( link, target );

            open( "http://www.google.com" , "_main");

            Thanks for help.

            Comment

            Working...