An alternative popup...

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

    #1

    An alternative popup...

    I'm looking at a different means of creating a popup to calling js. I'd
    like to use the standard <a href... target="_new"> syntax, so that I can
    dynamically control the content of the popup using php. However, I'd like
    to control the way it looks as you can with a javascript popup - no
    buttons, etc. I'm trying to do this by calling a js function at body
    onload=..., and have had some success - 've resized it, and moved it away
    from the top left corner of the screen. However, I am not a js programmer,
    and am having limited success using js 101 sites and google.

    So far, I've got

    <script language='javas cript'>
    var arrTemp=self.lo cation.href.spl it(\"?\");
    var picUrl = (arrTemp.length >0)?arrTemp[1]:\"\";
    var NS = (navigator.appN ame==\"Netscape \")?true:fal se;

    function FitPic() {
    self.blur();
    iWidth = (NS)?window.inn erWidth:documen t.body.clientWi dth;
    iHeight = (NS)?window.inn erHeight:docume nt.body.clientH eight;
    iWidth = " . $_GET["Width"] . " - iWidth + 250;
    iHeight = " . $_GET["Height"] . " - iHeight + 20;
    self.resizeBy(i Width, iHeight);
    self.moveTo (200, 200);
    self.focus();
    };
    </script>

    Can anyone point me to resources to tell me how to remove the standard
    browser buttons, or tell me that this approach makes it impossible???

    TIA,

    Steve
  • Steve

    #2
    Re: An alternative popup...

    On Sat, 04 Feb 2006 18:29:24 +1300, Steve wrote:
    [color=blue]
    > I'm looking at a different means of creating a popup to calling js. I'd
    > like to use the standard <a href... target="_new"> syntax, so that I can
    > dynamically control the content of the popup using php. However, I'd like
    > to control the way it looks as you can with a javascript popup - no
    > buttons, etc. I'm trying to do this by calling a js function at body
    > onload=..., and have had some success - 've resized it, and moved it away
    > from the top left corner of the screen. However, I am not a js programmer,
    > and am having limited success using js 101 sites and google.
    >
    > So far, I've got
    >
    > <script language='javas cript'>
    > var arrTemp=self.lo cation.href.spl it(\"?\");
    > var picUrl = (arrTemp.length >0)?arrTemp[1]:\"\";
    > var NS = (navigator.appN ame==\"Netscape \")?true:fal se;
    >
    > function FitPic() {
    > self.blur();
    > iWidth = (NS)?window.inn erWidth:documen t.body.clientWi dth;
    > iHeight = (NS)?window.inn erHeight:docume nt.body.clientH eight;
    > iWidth = " . $_GET["Width"] . " - iWidth + 250;
    > iHeight = " . $_GET["Height"] . " - iHeight + 20;
    > self.resizeBy(i Width, iHeight);
    > self.moveTo (200, 200);
    > self.focus();
    > };
    > </script>
    >
    > Can anyone point me to resources to tell me how to remove the standard
    > browser buttons, or tell me that this approach makes it impossible???
    >
    > TIA,
    >
    > Steve[/color]

    .... or, failing this, is it possible to pass the raw html code, rather
    than an URL to a more standard js popup() function?

    Comment

    • Sune Storgaard

      #3
      Re: An alternative popup...

      Steve wrote:[color=blue][color=green]
      >> Can anyone point me to resources to tell me how to remove the
      >> standard browser buttons, or tell me that this approach makes it
      >> impossible???[/color][/color]

      You have bigger problems than a popup, if you cant tell the difference
      between php & javascript.


      Comment

      • Steve

        #4
        Re: An alternative popup...

        On Sat, 04 Feb 2006 06:47:22 +0100, Sune Storgaard wrote:
        [color=blue]
        > Steve wrote:[color=green][color=darkred]
        >>> Can anyone point me to resources to tell me how to remove the
        >>> standard browser buttons, or tell me that this approach makes it
        >>> impossible???[/color][/color]
        >
        > You have bigger problems than a popup, if you cant tell the difference
        > between php & javascript.[/color]
        Thanks for your help. It's been really helpful. Given that it's early
        morning in Denmark, I expect you've had a heavy Friday night?

        Please tell me how *you* use a server side scripting language to generate
        a popup with dynamic content without going via an intermediate file of
        some kind, and use the JS window.open to control the display?

        Steve.

        Comment

        • Nicholas Sherlock

          #5
          Re: An alternative popup...

          Steve wrote:[color=blue]
          > Please tell me how *you* use a server side scripting language to generate
          > a popup with dynamic content without going via an intermediate file of
          > some kind, and use the JS window.open to control the display?[/color]

          Pop up a window. Write the code that generates the display in the .php
          file that you popped up.

          Cheers,
          Nicholas Sherlock

          Comment

          • Jim Michaels

            #6
            Re: An alternative popup...


            "Steve" <ThisOne@Aint.V alid> wrote in message
            news:pan.2006.0 2.04.05.34.08.2 48857@Aint.Vali d...[color=blue]
            > On Sat, 04 Feb 2006 18:29:24 +1300, Steve wrote:
            >[color=green]
            >> I'm looking at a different means of creating a popup to calling js. I'd
            >> like to use the standard <a href... target="_new"> syntax, so that I can
            >> dynamically control the content of the popup using php. However, I'd like
            >> to control the way it looks as you can with a javascript popup - no
            >> buttons, etc. I'm trying to do this by calling a js function at body
            >> onload=..., and have had some success - 've resized it, and moved it away
            >> from the top left corner of the screen. However, I am not a js
            >> programmer,
            >> and am having limited success using js 101 sites and google.
            >>
            >> So far, I've got
            >>
            >> <script language='javas cript'>
            >> var arrTemp=self.lo cation.href.spl it(\"?\");
            >> var picUrl = (arrTemp.length >0)?arrTemp[1]:\"\";
            >> var NS = (navigator.appN ame==\"Netscape \")?true:fal se;
            >>
            >> function FitPic() {
            >> self.blur();
            >> iWidth = (NS)?window.inn erWidth:documen t.body.clientWi dth;
            >> iHeight = (NS)?window.inn erHeight:docume nt.body.clientH eight;
            >> iWidth = " . $_GET["Width"] . " - iWidth + 250;
            >> iHeight = " . $_GET["Height"] . " - iHeight + 20;
            >> self.resizeBy(i Width, iHeight);
            >> self.moveTo (200, 200);
            >> self.focus();
            >> };
            >> </script>
            >>
            >> Can anyone point me to resources to tell me how to remove the standard
            >> browser buttons, or tell me that this approach makes it impossible???
            >>
            >> TIA,
            >>
            >> Steve[/color]
            >
            > ... or, failing this, is it possible to pass the raw html code, rather
            > than an URL to a more standard js popup() function?[/color]

            you are doing fine with your js so far.
            a standard way to opena window is
            window.open(url ,title,"width=1 00,height=100,t oolbar=no,locat ion=no,director ies=no,status=n o,menubar=no,sc rollbars=no,res izeable=no,copy history=no");

            maybe these attribute names will help you google for something.


            Comment

            • Jim Michaels

              #7
              Re: An alternative popup...


              "Steve" <ThisOne@Aint.V alid> wrote in message
              news:pan.2006.0 2.04.05.29.23.5 74829@Aint.Vali d...[color=blue]
              > I'm looking at a different means of creating a popup to calling js. I'd
              > like to use the standard <a href... target="_new"> syntax, so that I can
              > dynamically control the content of the popup using php. However, I'd like
              > to control the way it looks as you can with a javascript popup - no
              > buttons, etc. I'm trying to do this by calling a js function at body
              > onload=..., and have had some success - 've resized it, and moved it away
              > from the top left corner of the screen. However, I am not a js programmer,
              > and am having limited success using js 101 sites and google.
              >
              > So far, I've got
              >[/color]
              <script language="javas cript">
              var arrTemp=self.lo cation.href.spl it("?");
              var picUrl = (arrTemp.length >0)?arrTemp[1]:"";
              var NS = (navigator.appN ame=="Netscape" )?true:false;

              function FitPic() {
              self.blur();
              iWidth = (NS)?window.inn erWidth:documen t.body.clientWi dth;
              iHeight = (NS)?window.inn erHeight:docume nt.body.clientH eight;
              iWidth = <?php echo intval($_GET["Width"]); ?> - iWidth + 250;
              iHeight = <?php echo intval($_GET["Height"]); ?> - iHeight + 20;
              self.resizeBy(i Width, iHeight);
              self.moveTo (200, 200);
              self.focus();
              };
              </script>

              if it's any interest, W3C's HTML validator requires the script element to
              have the type="text/javascript" attribute.
              correction to your code made above to make it PHP compatible.
              I am told it's better (and faster) to drop out of the interpreter for HTML
              stuff than to echo huge amounts of HTML.

              [color=blue]
              >
              > Can anyone point me to resources to tell me how to remove the standard
              > browser buttons, or tell me that this approach makes it impossible???
              >
              > TIA,
              >
              > Steve[/color]


              Comment

              Working...