Open a page from search frame

Discussion in 'Javascript' started by Kojak, Sep 9, 2005.

  1. Kojak

    Kojak Guest

    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.value;
    document ??? .location.href='ViewPage.aspx?SrchKey=' + strKey +
    '&SrchString=' + strSearch ;
    event.returnValue = false;
    }

    Thanks for help
    Kojak
     
    Kojak, Sep 9, 2005
    #1
    1. Advertising

  2. Kojak

    Robert Guest

    Kojak wrote:
    > 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.


    window.frames["_main"].location.href = ...
     
    Robert, Sep 9, 2005
    #2
    1. Advertising

  3. Kojak

    Kojak Guest

    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
     
    Kojak, Sep 12, 2005
    #3
  4. Kojak

    Robert Guest

    Kojak wrote:
    > 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" ]....
    >


    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.frames["_main"].location.href=...
     
    Robert, Sep 12, 2005
    #4
  5. Kojak

    Kojak Guest

    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="javascript:search( );" />

    <script language="javascript">
    <!--
    function search( ) {
    var strSearch= document.forms(0).txtSearch.value;
    window.frames["_main"].location.href='SearchQuery.aspx?SrchString=' +
    strSearch ;
    }
    //-->

    maybe there is a javascript for the activ window or something?
     
    Kojak, Sep 13, 2005
    #5
  6. Kojak

    Kojak Guest

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

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

    Thanks for help.
     
    Kojak, Sep 13, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan
    Replies:
    2
    Views:
    489
    John W.
    Sep 2, 2003
  2. teo
    Replies:
    0
    Views:
    301
  3. Zalek Bloom
    Replies:
    1
    Views:
    223
    Aaron Bertrand - MVP
    Sep 23, 2003
  4. geefypants
    Replies:
    0
    Views:
    165
    geefypants
    Oct 28, 2004
  5. Kojak

    Open a page from search frame

    Kojak, Sep 9, 2005, in forum: Javascript
    Replies:
    0
    Views:
    100
    Kojak
    Sep 9, 2005
Loading...

Share This Page