open and close a window

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

    open and close a window

    Does anyone know how to open a window and have it close by itself? You
    may ask why, but here it is. I want to have it open (a php script), run
    that script, and then close itself.

    I have an application that is a huge AJAX framework app. There appears
    to be some interaction between that and the mail sending software I
    have. I want to send email with a file attached. The software I am
    using for that is htmlMimeMail5 (php5). Since I know the parameters, I
    simply want to run that php script outside of AJAX, but I don't want to
    leave open windows. A quick blast open, send, close is OK.

    I know that window.open opens the window and window.close closes it.
  • Evertjan.

    #2
    Re: open and close a window

    sheldonlg wrote on 11 jun 2008 in comp.lang.javas cript:
    Does anyone know how to open a window and have it close by itself? You
    may ask why, but here it is. I want to have it open (a php script), run
    that script, and then close itself.
    >
    I have an application that is a huge AJAX framework app. There appears
    to be some interaction between that and the mail sending software I
    have. I want to send email with a file attached. The software I am
    using for that is htmlMimeMail5 (php5). Since I know the parameters, I
    simply want to run that php script outside of AJAX, but I don't want to
    leave open windows. A quick blast open, send, close is OK.
    >
    I know that window.open opens the window and window.close closes it.
    Why would you want a window?
    You do not need any window to run a server script.

    <http://www.jibbering.c om/faq/#FAQ4_34>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • Dan Rumney

      #3
      Re: open and close a window

      sheldonlg wrote:
      Does anyone know how to open a window and have it close by itself? You
      may ask why, but here it is. I want to have it open (a php script), run
      that script, and then close itself.
      >
      Let's say you have a window A.

      It could execute a script to open window B which is pointing at your PHP
      script.

      Once that PHP script is complete, it can serve a simple HTML page, which
      includes a Javascript script to close itself.

      But, that means that you have 2 windows, running 2 separate scripts. Not
      a very elegant solution.

      This task seems perfectly suited to AJAX. I'm surprised that you're
      having 'interaction' issues between your AJAX framework and a back-end
      PHP script.

      It seems more likely that your AJAX framework is simply not sending all
      the relevant detail to the PHP script...

      Comment

      • sheldonlg

        #4
        Re: open and close a window

        Evertjan. wrote:
        sheldonlg wrote on 11 jun 2008 in comp.lang.javas cript:
        >
        >Does anyone know how to open a window and have it close by itself? You
        >may ask why, but here it is. I want to have it open (a php script), run
        >that script, and then close itself.
        >>
        >I have an application that is a huge AJAX framework app. There appears
        >to be some interaction between that and the mail sending software I
        >have. I want to send email with a file attached. The software I am
        >using for that is htmlMimeMail5 (php5). Since I know the parameters, I
        >simply want to run that php script outside of AJAX, but I don't want to
        >leave open windows. A quick blast open, send, close is OK.
        >>
        >I know that window.open opens the window and window.close closes it.
        >
        Why would you want a window?
        You do not need any window to run a server script.
        >
        <http://www.jibbering.c om/faq/#FAQ4_34>
        >
        Thanks. That is what I was looking for. I didn't know this about
        javascript (still learning js).

        "You trigger a server-side script by setting any object's URL. For
        example a frame, window, or an Image. An image will also "swallow" the
        data sent back by the server, so that they will not be visible anywhere."

        Thanks.

        Comment

        • sheldonlg

          #5
          Re: open and close a window

          Dan Rumney wrote:
          sheldonlg wrote:
          >Does anyone know how to open a window and have it close by itself?
          >You may ask why, but here it is. I want to have it open (a php
          >script), run that script, and then close itself.
          >>
          >
          Let's say you have a window A.
          >
          It could execute a script to open window B which is pointing at your PHP
          script.
          >
          Once that PHP script is complete, it can serve a simple HTML page, which
          includes a Javascript script to close itself.
          >
          But, that means that you have 2 windows, running 2 separate scripts. Not
          a very elegant solution.
          >
          This task seems perfectly suited to AJAX. I'm surprised that you're
          having 'interaction' issues between your AJAX framework and a back-end
          PHP script.
          >
          It seems more likely that your AJAX framework is simply not sending all
          the relevant detail to the PHP script...
          The code for the email works fine when used in a straight php script. I
          am guessing that it is the interaction. I know I had problems with the
          interaction when I wanted to use code to write an Excel file. I got
          around that by simply having the generator bypass the black box we use
          for handling all the AJAX calls.

          Comment

          Working...