How do I call this function

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

    #1

    How do I call this function

    I am new at this stuff.
    Can someone tell me how to CALL this function. PLease be very explicit in
    your explanation
    Many thnaks


    <SCRIPT language="JavaS cript">
    function messageWindow(t itle, msg)
    {
    var width="300", height="125"; var left = (screen.width/2) - width/2; var
    top = (screen.height/2) - height/2; var styleStr =
    'toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re sizable=no,copy history=yes,wid th='+width+',he ight='+height+' ,left='+left+', top='+top+',scr eenX='+left+',s creenY='+top;
    var msgWindow = window.open("", "msgWindow" , styleStr); var head = '
    </SCRIPT>

    --
    Norton Professional 2004 says this email is clean...believe it


  • Ivan Marsh

    #2
    Re: How do I call this function

    On Tue, 02 Nov 2004 15:26:12 -0500, PCOR wrote:
    [color=blue]
    > I am new at this stuff.
    > Can someone tell me how to CALL this function. PLease be very explicit in
    > your explanation
    > Many thnaks
    >
    >
    > <SCRIPT language="JavaS cript">
    > function messageWindow(t itle, msg)
    > {
    > var width="300", height="125"; var left = (screen.width/2) - width/2;
    > var
    > top = (screen.height/2) - height/2; var styleStr =
    > 'toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re sizable=no,copy history=yes,wid th='+width+',he ight='+height+' ,left='+left+', top='+top+',scr eenX='+left+',s creenY='+top;
    > var msgWindow = window.open("", "msgWindow" , styleStr); var head = '
    > </SCRIPT>[/color]

    <script type='text/javascript'>
    messageWindow(' My Title', 'My message');
    </script>

    --
    i.m.
    The USA Patriot Act is the most unpatriotic act in American history.

    Comment

    • PCOR

      #3
      Re: How do I call this function

      Hi
      Tried that but.........I could not get it to work
      I place the function in the "HEAD" and the code you gave in the "BODY" but
      nothing happened. Any suggestions
      Thanks

      "Ivan Marsh" <annoyed@you.no w> wrote in message
      news:pan.2004.1 1.02.20.31.32.5 77667@you.now.. .[color=blue]
      > On Tue, 02 Nov 2004 15:26:12 -0500, PCOR wrote:
      >[color=green]
      >> I am new at this stuff.
      >> Can someone tell me how to CALL this function. PLease be very explicit in
      >> your explanation
      >> Many thnaks
      >>
      >>
      >> <SCRIPT language="JavaS cript">
      >> function messageWindow(t itle, msg)
      >> {
      >> var width="300", height="125"; var left = (screen.width/2) - width/2;
      >> var
      >> top = (screen.height/2) - height/2; var styleStr =
      >> 'toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re sizable=no,copy history=yes,wid th='+width+',he ight='+height+' ,left='+left+', top='+top+',scr eenX='+left+',s creenY='+top;
      >> var msgWindow = window.open("", "msgWindow" , styleStr); var head = '
      >> </SCRIPT>[/color]
      >
      > <script type='text/javascript'>
      > messageWindow(' My Title', 'My message');
      > </script>
      >
      > --
      > i.m.
      > The USA Patriot Act is the most unpatriotic act in American history.
      >[/color]


      Comment

      • Joakim Braun

        #4
        Re: How do I call this function

        "PCOR" <ianmacfa@hotma il.com> skrev i meddelandet
        news:GaednRelc8 pbbhrcRVn-ig@rogers.com.. .[color=blue]
        > Hi
        > Tried that but.........I could not get it to work
        > I place the function in the "HEAD" and the code you gave in the "BODY" but
        > nothing happened. Any suggestions
        > Thanks
        >
        > "Ivan Marsh" <annoyed@you.no w> wrote in message
        > news:pan.2004.1 1.02.20.31.32.5 77667@you.now.. .[color=green]
        > > On Tue, 02 Nov 2004 15:26:12 -0500, PCOR wrote:
        > >[color=darkred]
        > >> I am new at this stuff.
        > >> Can someone tell me how to CALL this function. PLease be very explicit[/color][/color][/color]
        in[color=blue][color=green][color=darkred]
        > >> your explanation
        > >> Many thnaks
        > >>
        > >>
        > >> <SCRIPT language="JavaS cript">
        > >> function messageWindow(t itle, msg)
        > >> {
        > >> var width="300", height="125"; var left = (screen.width/2) - width/2;
        > >> var
        > >> top = (screen.height/2) - height/2; var styleStr =
        > >>[/color][/color][/color]
        'toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re s
        izable=no,copyh istory=yes,widt h='+width+',hei ght='+height+', left='+left+',t o
        p='+top+',scree nX='+left+',scr eenY='+top;[color=blue][color=green][color=darkred]
        > >> var msgWindow = window.open("", "msgWindow" , styleStr); var head = '
        > >> </SCRIPT>[/color]
        > >
        > > <script type='text/javascript'>
        > > messageWindow(' My Title', 'My message');
        > > </script>[/color][/color]

        Remove the nonsensical "var head = '" at the end, add a closing } to the
        function, check for popup-blocking software (including browser preferences),
        and write again if it doesn't work.

        Joakim Braun


        Comment

        • Michael Winter

          #5
          Re: How do I call this function

          On Tue, 2 Nov 2004 15:53:23 -0500, PCOR <ianmacfa@hotma il.com> wrote:
          [color=blue]
          > Tried that but.........I could not get it to work
          > I place the function in the "HEAD" and the code you gave in the "BODY"
          > but nothing happened.[/color]

          That's because the code contains syntax errors and is obviously
          incomplete. That's something for you to fix, not us.

          In another matter, most of the features passed to the window.open() call
          are a bad idea. You shouldn't remove chrome elements or try to position
          the window. Their removal, and opening new windows in general, are bad for
          usability.

          [snip quoted text]

          Mike


          Please don't top-post.

          Replies should be placed inline with the relevant quoted material.
          Unrelated material should be deleted (and preferably marked as such).

          Signatures from previous posts should be deleted unless you are commenting
          on them. In that case, make sure the delimiter, "-- ", has been deleted.

          --
          Michael Winter
          Replace ".invalid" with ".uk" to reply by e-mail.

          Comment

          • PCOR

            #6
            Re: How do I call this function

            That did the trick...many thanks
            Now can you tell me how to get some text or/and a picture into that message
            box..
            Most sincere thanks

            "Joakim Braun" <joakim.braun@j fbraun.removeth is.com> wrote in message
            news:rHShd.1142 0$1p.9553@nntps erver.swip.net. ..[color=blue]
            > "PCOR" <ianmacfa@hotma il.com> skrev i meddelandet
            > news:GaednRelc8 pbbhrcRVn-ig@rogers.com.. .[color=green]
            >> Hi
            >> Tried that but.........I could not get it to work
            >> I place the function in the "HEAD" and the code you gave in the "BODY"
            >> but
            >> nothing happened. Any suggestions
            >> Thanks
            >>
            >> "Ivan Marsh" <annoyed@you.no w> wrote in message
            >> news:pan.2004.1 1.02.20.31.32.5 77667@you.now.. .[color=darkred]
            >> > On Tue, 02 Nov 2004 15:26:12 -0500, PCOR wrote:
            >> >
            >> >> I am new at this stuff.
            >> >> Can someone tell me how to CALL this function. PLease be very explicit[/color][/color]
            > in[color=green][color=darkred]
            >> >> your explanation
            >> >> Many thnaks
            >> >>
            >> >>
            >> >> <SCRIPT language="JavaS cript">
            >> >> function messageWindow(t itle, msg)
            >> >> {
            >> >> var width="300", height="125"; var left = (screen.width/2) -
            >> >> width/2;
            >> >> var
            >> >> top = (screen.height/2) - height/2; var styleStr =
            >> >>[/color][/color]
            > 'toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re s
            > izable=no,copyh istory=yes,widt h='+width+',hei ght='+height+', left='+left+',t o
            > p='+top+',scree nX='+left+',scr eenY='+top;[color=green][color=darkred]
            >> >> var msgWindow = window.open("", "msgWindow" , styleStr); var head = '
            >> >> </SCRIPT>
            >> >
            >> > <script type='text/javascript'>
            >> > messageWindow(' My Title', 'My message');
            >> > </script>[/color][/color]
            >
            > Remove the nonsensical "var head = '" at the end, add a closing } to the
            > function, check for popup-blocking software (including browser
            > preferences),
            > and write again if it doesn't work.
            >
            > Joakim Braun
            >
            >[/color]


            Comment

            • McKirahan

              #7
              Re: How do I call this function

              "PCOR" <ianmacfa@hotma il.com> wrote in message
              news:1b2dnVXPCd 7CZhrcRVn-3g@rogers.com.. .[color=blue]
              > That did the trick...many thanks
              > Now can you tell me how to get some text or/and a picture into that[/color]
              message[color=blue]
              > box..
              > Most sincere thanks[/color]

              [snip]

              Try the following "as-is"; watch for word-wrap.

              <html>
              <head>
              <title>ianmacfa .htm</title>
              <script type="text/javascript">
              function messageWindow(t itle, msg) {
              var width = "300"
              var height = "150";
              var left = (screen.width/2) - width/2;
              var top = (screen.height/2) - height/2;
              var cfg =
              "toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re s
              izable=no";
              cfg += ",width=" + width + ",height=" + height + ",left=" + left +
              ",top=" + top;
              var win = window.open("", "win", cfg);
              var htm = "<html><head><t itle>" + title +
              "</title></head><body><cen ter>";
              htm += "<b>" + msg + "</b>";
              htm += "<br><img src='http://www.google.com/logos/vote2004.gif'
              border='0' alt=''>";
              htm += "</center></body></html>";
              win.document.wr ite(htm);
              }
              </script>
              </head>
              <body>
              <script type="text/javascript">
              messageWindow(" My Title","My message");
              </script>
              </body>
              </html>

              Note that I removed:
              a) ,copyhistory=ye s
              b) ' ,screenX='+left
              c) ',screenY='+top


              Comment

              • Andrew Thompson

                #8
                Re: How do I call this function

                On Tue, 2 Nov 2004 15:53:23 -0500, PCOR wrote:

                Please refrain form top-posting PCOR..
                <http://www.physci.org/codes/javafaq.jsp#net iquette>

                See further comments below.
                [color=blue]
                > "Ivan Marsh" <annoyed@you.no w> wrote in message
                > news:pan.2004.1 1.02.20.31.32.5 77667@you.now.. .[color=green]
                >> On Tue, 02 Nov 2004 15:26:12 -0500, PCOR wrote:
                >>[color=darkred]
                >>> Can someone tell me how to CALL this function.[/color][/color][/color]
                ...[color=blue][color=green][color=darkred]
                >>> <SCRIPT language="JavaS cript">
                >>> function messageWindow(t itle, msg)[/color][/color][/color]
                ....[color=blue][color=green]
                >> <script type='text/javascript'>
                >> messageWindow(' My Title', 'My message');
                >> </script>[/color][/color]
                ....[color=blue]
                > Tried that but.........I could not get it to work[/color]

                Lazy was it? Try flogging it with a whip. [ ;-) ]

                A better way to deal with errors is to produce the JS console
                or error message window (and before you go blurting out an
                excited 'How?', state your browser.)
                [color=blue]
                > I place the function in the "HEAD" and the code you gave in the "BODY" but
                > nothing happened. Any suggestions[/color]

                Supply an URL, as recommended by this document
                for gettting help on stylesheets..
                <http://www.spartanicus .utvinternet.ie/help_us_help_yo u.htm>
                ...and mirrored in my oan document on debugging Java..
                <http://www.physci.org/codes/sscce.jsp>

                HTH

                --
                Andrew Thompson
                http://www.PhySci.org/codes/ Web & IT Help
                http://www.PhySci.org/ Open-source software suite
                http://www.1point1C.org/ Science & Technology
                http://www.LensEscapes.com/ Images that escape the mundane

                Comment

                • PCOR

                  #9
                  Re: How do I call this function

                  Thanks for the effort but nogo.
                  I was just wondering if a number of double quotes like this " are suppose
                  to be there
                  "McKirahan" <News@McKirahan .com> wrote in message
                  news:LbThd.3463 90$MQ5.228118@a ttbi_s52...[color=blue]
                  > "PCOR" <ianmacfa@hotma il.com> wrote in message
                  > news:1b2dnVXPCd 7CZhrcRVn-3g@rogers.com.. .[color=green]
                  >> That did the trick...many thanks
                  >> Now can you tell me how to get some text or/and a picture into that[/color]
                  > message[color=green]
                  >> box..
                  >> Most sincere thanks[/color]
                  >
                  > [snip]
                  >
                  > Try the following "as-is"; watch for word-wrap.
                  >
                  > <html>
                  > <head>
                  > <title>ianmacfa .htm</title>
                  > <script type="text/javascript">
                  > function messageWindow(t itle, msg) {
                  > var width = "300"
                  > var height = "150";
                  > var left = (screen.width/2) - width/2;
                  > var top = (screen.height/2) - height/2;
                  > var cfg =
                  > "toolbar=no,loc ation=no,direct ories=no,status =no,menubar=no, scrollbar=no,re s
                  > izable=no";
                  > cfg += ",width=" + width + ",height=" + height + ",left=" + left +
                  > ",top=" + top;
                  > var win = window.open("", "win", cfg);
                  > var htm = "<html><head><t itle>" + title +
                  > "</title></head><body><cen ter>";
                  > htm += "<b>" + msg + "</b>";
                  > htm += "<br><img src='http://www.google.com/logos/vote2004.gif'
                  > border='0' alt=''>";
                  > htm += "</center></body></html>";
                  > win.document.wr ite(htm);
                  > }
                  > </script>
                  > </head>
                  > <body>
                  > <script type="text/javascript">
                  > messageWindow(" My Title","My message");
                  > </script>
                  > </body>
                  > </html>
                  >
                  > Note that I removed:
                  > a) ,copyhistory=ye s
                  > b) ' ,screenX='+left
                  > c) ',screenY='+top
                  >
                  >[/color]


                  Comment

                  • McKirahan

                    #10
                    Re: How do I call this function

                    "PCOR" <ianmacfa@hotma il.com> wrote in message
                    news:JJmdnfRl-53nkBXcRVn-iQ@rogers.com.. .[color=blue]
                    > Thanks for the effort but nogo.
                    > I was just wondering if a number of double quotes like this " are suppose
                    > to be there[/color]

                    [snip]

                    What do you mean "nogo" (as in "no go")?

                    Did you get an error?


                    Comment

                    • PCOR

                      #11
                      Re: How do I call this function

                      The message book did NOT show up on the screen
                      Thanks again for your help...and I can still use it


                      "McKirahan" <News@McKirahan .com> wrote in message
                      news:hnWhd.4567 01$mD.241936@at tbi_s02...[color=blue]
                      > "PCOR" <ianmacfa@hotma il.com> wrote in message
                      > news:JJmdnfRl-53nkBXcRVn-iQ@rogers.com.. .[color=green]
                      >> Thanks for the effort but nogo.
                      >> I was just wondering if a number of double quotes like this " are
                      >> suppose
                      >> to be there[/color]
                      >
                      > [snip]
                      >
                      > What do you mean "nogo" (as in "no go")?
                      >
                      > Did you get an error?
                      >
                      >[/color]


                      Comment

                      • Ian Mac

                        #12
                        Re: How do I call this function


                        No error but no message box either


                        *** Sent via Developersdex http://www.developersdex.com ***
                        Don't just participate in USENET...get rewarded for it!

                        Comment

                        • McKirahan

                          #13
                          Re: How do I call this function

                          "PCOR" <ianmacfa@hotma il.com> wrote in message
                          news:vbCdnQcIJu 4skhTcRVn-2g@rogers.com.. .[color=blue]
                          > The message book did NOT show up on the screen
                          > Thanks again for your help...and I can still use it[/color]

                          [snip]

                          Finally, I understand (somewhat).

                          You had asked "Now can you tell me how to get some text or/and a picture
                          into that message box.." but the way the line wrapped I didn't see the word
                          "box" so I thought you just wanted a message. Then your replay said the the
                          "message book" didn't work so I didn't know what you were refering to.

                          Anyway, what are you looking for? There is no "message box" (as in
                          VBScript's "MsgBox()") ; however, there is a window which I showed you how to
                          get an image into.


                          Comment

                          Working...