function/parameters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • propedeutique@yahoo.fr

    function/parameters

    Hello,

    I have a problem with the following function:
    I would like to define the hight/length of the window which I open when
    I call the function.
    The problem is that the window opens but not with the size I defined
    when calling the function.

    Tanks for your help.


    <head>
    <script LANGUAGE="JavaS cript">
    function FuncWindow(strP age,Vlargeur,Vh auteur,)

    {
    var Vhauteur
    var Vlargeur
    string=
    "toolbar=0,scro llbars=1,locati on=0,statusbar= 0,menubar=0,res izable=1,width= Vlargeur,height =Vhauteur,Left= 200,Top=100";
    fin=window.open (strPage,"Find" ,string);
    fin.focus();
    // document.write (Vhauteur)
    }
    </script>
    </head>

    <body>
    <A
    onclick="FuncWi ndow('../pages/aide/perso_accueil_c odepostal.asp', 300,500)">

    <input type="button" name="btnEntrer " value=" Entrer " ></a>
    </body>

  • sujanrb@gmail.com

    #2
    Re: function/parameters

    Hello,

    This script works.

    <head>

    <script language="JavaS cript">

    function FuncWindow(strP age, string) {
    fin = window.open(str Page, "Find", string);
    fin.focus();
    // document.write( Vhauteur);
    }
    </script>

    </head>

    <body>
    <input type="button" name="btnEntrer " value="Entrer"
    onClick="FuncWi ndow('../pages/aide/perso_accueil_c odepostal.asp',
    'toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0,
    resizable=1, width=500, height=480, left=200, top=100');" />
    </body>

    Comment

    • Mick White

      #3
      Re: function/parameters

      propedeutique@y ahoo.fr wrote:[color=blue]
      > Hello,
      >
      > I have a problem with the following function:
      > I would like to define the hight/length of the window which I open when
      > I call the function.
      > The problem is that the window opens but not with the size I defined
      > when calling the function.
      >[/color]
      [...]
      function FuncWindow(strP age,Vlargeur,Vh auteur){
      string=
      "resizable=1,wi dth="+Vlargeur+ ",height="+Vhau teur+",left=200 ,top=100";
      fin=window.open (strPage,"Find" ,string);
      }

      scrollbars will be added if the document needs them.
      Mick

      Comment

      • propedeutique@yahoo.fr

        #4
        Re: function/parameters

        Thanks from a newby to both of you.
        It works fine.
        Bi

        Comment

        • Danny

          #5
          Re: function/parameters



          You have to concatenate the arguments:

          string="toolbar =0,scrollbars=1 ,location=0,sta tusbar=0,menuba r=0,resizable=1 ,width="+Vlarge ur+",height="+V hauteur+",Left= 200,Top=100";

          Danny

          On Thu, 23 Jun 2005 03:00:19 -0700, <propedeutique@ yahoo.fr> wrote:
          [color=blue]
          > Hello,
          >
          > I have a problem with the following function:
          > I would like to define the hight/length of the window which I open when
          > I call the function.
          > The problem is that the window opens but not with the size I defined
          > when calling the function.
          >
          > Tanks for your help.
          >
          >
          > <head>
          > <script LANGUAGE="JavaS cript">
          > function FuncWindow(strP age,Vlargeur,Vh auteur,)
          >
          > {
          > var Vhauteur
          > var Vlargeur
          > string=
          > "toolbar=0,scro llbars=1,locati on=0,statusbar= 0,menubar=0,res izable=1,width= Vlargeur,height =Vhauteur,Left= 200,Top=100";
          > fin=window.open (strPage,"Find" ,string);
          > fin.focus();
          > // document.write (Vhauteur)
          > }
          > </script>
          > </head>
          >
          > <body>
          > <A
          > onclick="FuncWi ndow('../pages/aide/perso_accueil_c odepostal.asp', 300,500)">
          >
          > <input type="button" name="btnEntrer " value=" Entrer " ></a>
          > </body>
          >[/color]



          --
          Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: function/parameters

            sujanrb@gmail.c om wrote:
            [color=blue]
            > This script works.[/color]

            No, it does not.
            [color=blue]
            > <head>
            >
            > <script language="JavaS cript">[/color]

            <http://validator.w3.or g/>
            [color=blue]
            > function FuncWindow(strP age, string) {
            > fin = window.open(str Page, "Find", string);[/color]

            The value of `string' is used here "as is", however you pass it
            below containing spaces that it must not contain.
            [color=blue]
            > fin.focus();[/color]

            You do not test for the host object's method before you call it.
            Error-prone.

            <http://validator.w3.or g/>
            [color=blue]
            > // document.write( Vhauteur);[/color]

            Your point?
            [color=blue]
            > }
            > </script>
            >
            > </head>
            >
            > <body>
            > <input type="button" name="btnEntrer " value="Entrer"
            > onClick="FuncWi ndow('../pages/aide/perso_accueil_c odepostal.asp',
            > 'toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0,
            > resizable=1, width=500, height=480, left=200, top=100');" />[/color]

            People using a UA without client-side script support will not
            be able to make use of that button. Please Read the FAQ before
            you post.

            <http://jibbering.com/faq/#FAQ4_24>


            PointedEars

            Comment

            Working...