netscape vs ie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry A. Haimann

    #1

    netscape vs ie

    I have the following function that works under netscape 7, but doesn't
    work under ie. What changes should be made to make it run under ie?

    function ButFunction()
    {
    var Page;
    var s;
    var d;
    var h, w;

    s = document.SrchFo rm.SearchDB.val ue;
    d = document.SrchFo rm.DetailDB.val ue;
    d = d - 1;

    Page = "Table_Page.htm l?" + "sch=" +
    document.SrchFo rm.SearchDB.opt ions[s].text + "&" +
    "dtl=" + document.SrchFo rm.DetailDB.opt ions[d].text;
    var newWindow = open(Page, "Records Selected", "fullscreen=yes ");
    }
  • Lasse Reichstein Nielsen

    #2
    Re: netscape vs ie

    "Terry A. Haimann" <terry@yngstr.o ldboy.com> writes:
    [color=blue]
    > I have the following function that works under netscape 7, but doesn't
    > work under ie. What changes should be made to make it run under ie?[/color]

    There are three things that you need to tell when you ask for help
    with code that doesn't work:

    1) What did you do? The code is a beginning, but how is it called?
    What is on the page? What browser are you using (you said this one)?
    2) What did you expect to happen? I.e., what was your intention. It
    is hard to tell you what to change if we don't know the goal.
    3) What really happened? "Didn't work" is not sufficient. We know
    that, otherwise you wouldn't ask. Error messages, or their absence,
    and any visible effect, or absence of it.
    [color=blue]
    > function ButFunction()
    > {
    > var Page;
    > var s;
    > var d;
    > var h, w;
    >
    > s = document.SrchFo rm.SearchDB.val ue;[/color]

    I prefer
    s = document.forms['SrchForm'].elements['SearchDB'].value;
    However, if it works in Mozilla/Netscape without these collections,
    then it probably also works in IE.
    [color=blue]
    > var newWindow = open(Page, "Records Selected", "fullscreen=yes ");[/color]

    Most likely error: Window names are not allowed to contain spaces.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Michael Winter

      #3
      Re: netscape vs ie

      Terry A. Haimann wrote on 19 Nov 2003:
      [color=blue]
      > I have the following function that works under netscape 7, but
      > doesn't work under ie. What changes should be made to make it
      > run under ie?
      >
      > function ButFunction()
      > {
      > var Page;
      > var s;
      > var d;
      > var h, w;
      >
      > s = document.SrchFo rm.SearchDB.val ue;
      > d = document.SrchFo rm.DetailDB.val ue;
      > d = d - 1;[/color]

      What exactly are you trying to do here? The Select.options array
      expects an numerical index, so unless the value of each option in the
      select menu is its own index, your code below shouldn't work. If the
      option values do contain their index, you've picked an awkward way of
      doing things. This would probably be better:

      var s = document.forms['SrchForm'].SearchDB.selec tedIndex;
      var d = document.forms['SrchForm'].DetailDB.selec tedIndex--;

      There's also no need for the separate decrement, and the values could
      be a little more meaningful (if appropriate).

      Note: Select.selected Index will return zero-based indexes, so using
      the above means that the first option in the DetailDB menu cannot be
      selected. In that case, 'd' would be -1 and that's out of range for
      the Select.options array.
      [color=blue]
      > Page = "Table_Page.htm l?" + "sch=" +
      > document.SrchFo rm.SearchDB.opt ions[s].text + "&" +
      > "dtl=" + document.SrchFo rm.DetailDB.opt ions[d].text;
      > var newWindow = open(Page, "Records Selected", "fullscreen=yes ");[/color]

      'fullscreen' is not a valid feature for a window (not by my
      references, anyway), and it has been said in this group many times
      now that trying to manipulate the user's browser dimensions is a bad
      idea.

      'Records Selected' is invalid. Remove the space or replace it with an
      underscore. A window name is the same as a frame name and must begin
      with a letter, and only contain letters, digits, hyphens (-),
      underscores (_), periods (.), and colons (:). However, if you refer
      to a name that contains anything other than alphanumeric characters,
      you should use the appropriate collection and "quote" the name (like
      I did earlier, using document.forms) .

      You should also use window.open(... ) to make the call to
      window.open() less ambiguous, and to avoid accidentally calling
      document.open() .

      Hope that helps,

      Mike

      --
      Michael Winter
      M.Winter@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

      Comment

      • Terry A. Haimann

        #4
        Re: netscape vs ie

        On Thu, 20 Nov 2003 00:39:43 +0100, Lasse Reichstein Nielsen wrote:
        [color=blue]
        > Most likely error: Window names are not allowed to contain spaces.[/color]

        Yes that was the problem, Thx

        Comment

        Working...