problem with Internet Explorer

Discussion in 'Javascript' started by Yve, Nov 14, 2003.

  1. Yve

    Yve Guest

    Hallo,

    this testweb works well in Mozilla and Netscape but not in Internet
    Explorer.

    http://www.netzwerkservice.com/test/frame/test_javascript_1007/

    As I am not good at JavaScript I have got no idea where to look fot
    the bug.

    I kindly ask you for your help.

    I add the parts of code that might be buggy.

    Thank you very much for your patience with newbies.

    Yvonne



    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    ..
    ..
    ..
    <script language="JavaScript">
    <!--
    function Go(x)
    {
    if(x == "nothing")
    {
    document.forms[0].reset();
    document.forms[0].elements[0].blur();
    return;
    }
    else if(x == "end") top.location.href = parent.frames[1].location;
    else
    {
    parent.frames[1].location.href = x;
    document.forms[0].reset();
    document.forms[0].elements[0].blur();
    }
    }
    //-->
    </script>
    ..
    ..
    ..
    <form>
    <select name="bereich1"
    onChange="Go(this.form.bereich1.options[this.form.bereich1.options.selectedIndex].value)"
    width="50">
    <option value="nothing">Bereich1
    <option value="nothing">. . . . . . . </option>
    <option value=""onClick="parent.content.location='../content/content_gelb.html';
    parent.thumbs.location='../thumbs/thumbs_gelb.html'; return
    false;">gelb</option>
    <option value=""onClick="parent.content.location='../content/content_blau.html';
    parent.thumbs.location='../thumbs/thumbs_blau.html'; return
    false;">blau</option>
    </select>
    </form>
    </td>
    <td width="25" valign="bottom">&nbsp;</td>
    <td width="155">
    <form>
    <select name="bereich2"
    onChange="Go(this.form.bereich2.options[this.form.bereich2.options.selectedIndex].value)"
    width="50">
    <option value="nothing">Bereich2 </option>
    <option value="nothing">. . . . . . . </option>
    <option value=""onClick="parent.content.location='../content/content_rot.html';
    parent.thumbs.location='../thumbs/thumbs_rot.html'; return
    false;">rot</option>
    <option value=""onClick="parent.content.location='../content/content_gruen.html';
    parent.thumbs.location='../thumbs/thumbs_gruen.html'; return
    false;">grĂ¼n</option>
    </select>
    </form>
    ..
    ..
    ..
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    Yve, Nov 14, 2003
    #1
    1. Advertising

  2. "Yve" <> schreef in bericht
    news:...
    >
    > this testweb works well in Mozilla and Netscape but not in Internet
    > Explorer.
    >


    Try it as follows:

    function Go(x) {
    if (x != "nothing") {
    parent.content.location = x.split('|')[0];
    parent.thumbs.location = x.split('|')[1];
    }
    document.forms[0].reset();
    document.forms[0].elements[0].blur();
    }

    <select size=1 name="bereich1" onChange="Go(value)" width="50">
    <option value="nothing">Bereich1
    <option value="nothing">. . . . . . . </option>
    <option
    value="../content/content_gelb.html|../thumbs/thumbs_gelb.html">gelb</option
    >

    <option
    value="../content/content_blau.html|../thumbs/thumbs_blau.html">blau</option
    >

    </select>

    BTW, the Go function only resets the first form. This can be fixed, of
    course, but I think you should use only 1 form to encapsule both select
    elements.

    When the names of pages are constant, you could also use the following:

    function Go(x) {
    if (x != "nothing") {
    parent.content.location = "../content/content_" + x + ".html";
    parent.thumbs.location = "../thumbs/thumbs_" + x + ".html";
    }
    document.forms[0].reset();
    document.forms[0].elements[0].blur();
    }

    <select size=1 name="bereich1" onChange="Go(value)" width="50">
    <option value="nothing">Bereich1
    <option value="nothing">. . . . . . . </option>
    <option value="gelb">gelb</option>
    <option value="blau">blau</option>
    </select>

    HTH,
    JW
    Janwillem Borleffs, Nov 15, 2003
    #2
    1. Advertising

  3. Yve

    Yve Guest

    A friend solved the problem (exchanging more than 1 frame out of drop
    dowm menu)by this:

    function GoToURL(val)
    {
    if(val == "nothing")
    {
    document.forms[0].reset();
    document.forms[0].elements[0].blur();
    return;
    } else if (val == "end") {
    top.location.href = parent.frames[1].location;
    } else {
    //alert (val);
    eval(val);
    document.forms[1].reset();
    //document.forms[0].elements[0].blur();
    }
    }

    Yvonne.
    Yve, Nov 23, 2003
    #3
    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. Adrian Stovold
    Replies:
    0
    Views:
    351
    Adrian Stovold
    Mar 3, 2004
  2. cmay
    Replies:
    0
    Views:
    1,127
  3. Mythran

    Internet Explorer Render Problem

    Mythran, Sep 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    615
    Bruce Barker
    Sep 15, 2005
  4. Ed Hauptman
    Replies:
    7
    Views:
    1,010
    Ed Hauptman
    Aug 7, 2009
  5. John Smith
    Replies:
    1
    Views:
    137
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page