Re: JS alert that links to a file

From: Date: Mon, 27 Jul 2009 03:28:03 +0000
Subject: Re: JS alert that links to a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-295854@lists.php.net to get a copy of this message
On Sun, Jul 26, 2009 at 09:55:14PM -0500, Skip Evans wrote: > Okay, I know I've done this before, but now I'm blanking out. > > I have code that creates a CSV file, and when it's done I want > a JS alert to pop up and let them save the file. > > Isn't this some kind of alert() type call on the JS side??? > > I know I've done this before and I've been on Google an hour now! Not sure I understand your question, but there is a function called alert() in javascript. It opens a window with your error message in it. I don't know of a way to trigger this from PHP, since PHP is server-side and Javascript is client-side. You might be able to have javascript scan for the existence/closing of the file in question and then alert the user. Or you could have PHP, when the file is complete, launch a new page which contains the javascript code to alert the user. Paul -- Paul M. Foster

« previous php.general (#295854) next »