HighDots Forums  

open and close a window

Javascript JavaScript language (comp.lang.javascript)


Discuss open and close a window in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sheldonlg
 
Posts: n/a

Default open and close a window - 06-11-2008 , 02:18 PM






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.

Reply With Quote
  #2  
Old   
Evertjan.
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 02:29 PM






sheldonlg wrote on 11 jun 2008 in comp.lang.javascript:

Quote:
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.com/faq/#FAQ4_34>

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


Reply With Quote
  #3  
Old   
Dan Rumney
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 02:31 PM



sheldonlg wrote:
Quote:
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...


Reply With Quote
  #4  
Old   
Travis Newbury
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 03:57 PM



On Jun 11, 3:18 pm, sheldonlg <sheldonlg> wrote:
Quote:
Does anyone know how to open a window and have it close by itself?
Well just pull like hell and check to make sure that it was not
painted shut to get it open. The closing by itself part can usually
be achieved with a little grease or WD40 on the pullies.

Quote:
You may ask why
Nope, I really don't give a shit why you want to do this, but I guess
your going to tell me anyway...

Quote:
I have an application that is a huge AJAX framework app.
Well you obviously didn't write it yourself or you would already know
the answer to your very basic question.

Quote:
There appears...
Ok, I've lost interest again... Oh yea, why not google ajax send mail
php and see if you don't get your answer.


Reply With Quote
  #5  
Old   
sheldonlg
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 07:12 PM



Evertjan. wrote:
Quote:
sheldonlg wrote on 11 jun 2008 in comp.lang.javascript:

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.com/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.


Reply With Quote
  #6  
Old   
sheldonlg
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 07:16 PM



Travis Newbury wrote:
Quote:
On Jun 11, 3:18 pm, sheldonlg <sheldonlg> wrote:
Does anyone know how to open a window and have it close by itself?

Well just pull like hell and check to make sure that it was not
painted shut to get it open. The closing by itself part can usually
be achieved with a little grease or WD40 on the pullies.

You may ask why

Nope, I really don't give a shit why you want to do this, but I guess
your going to tell me anyway...

I have an application that is a huge AJAX framework app.

Well you obviously didn't write it yourself or you would already know
the answer to your very basic question.

There appears...

Ok, I've lost interest again... Oh yea, why not google ajax send mail
php and see if you don't get your answer.
Thanks for nothing. BTW:

1 - I did google and it didn't tell me anything. Especially, since this
is a js problem and not a php problem

2 - No, I didn't write the AJAX code. We treat it pretty much as a
black box for the application -- which I **did** write. I have also
written a little AJAX on my own, but I was looking to see if there was
some simpler way -- and there is. I just have to create an image and
set the url for that image to be the php script.

Again TFN. Evertjan was a big help.


Reply With Quote
  #7  
Old   
sheldonlg
 
Posts: n/a

Default Re: open and close a window - 06-11-2008 , 07:19 PM



Dan Rumney wrote:
Quote:
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.


Reply With Quote
  #8  
Old   
Travis Newbury
 
Posts: n/a

Default Re: open and close a window - 06-12-2008 , 04:36 AM



On Jun 11, 8:16 pm, sheldonlg <sheldonlg> wrote:
Quote:
Ok, I've lost interest again... Oh yea, why not google ajax send mail
php and see if you don't get your answer.
Thanks for nothing. BTW:
Whine... whine... whine... Does your pussy hurt too?




Reply With Quote
  #9  
Old   
sheldonlg
 
Posts: n/a

Default Re: open and close a window - 06-12-2008 , 10:58 PM



Travis Newbury wrote:
Quote:
On Jun 11, 8:16 pm, sheldonlg <sheldonlg> wrote:
Ok, I've lost interest again... Oh yea, why not google ajax send mail
php and see if you don't get your answer.
Thanks for nothing. BTW:

Whine... whine... whine... Does your pussy hurt too?
Gee, I don't know. When was the last time you checked yourself?

(Reply if you wish. I hereby terminate this nonsense).


Reply With Quote
  #10  
Old   
Travis Newbury
 
Posts: n/a

Default Re: open and close a window - 06-13-2008 , 05:37 AM



On Jun 12, 11:58 pm, sheldonlg <sheldonlg> wrote:
Quote:
Ok, I've lost interest again... Oh yea, why not google ajax send mail
php and see if you don't get your answer.
Thanks for nothing. BTW:
Whine... whine... whine... Does your pussy hurt too?
Gee, I don't know. When was the last time you checked yourself?
Oh, the old "I know you are but what am I" comeback. Impressive...


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.