Rune Hammerskov wrote:
I have a javascript where the following line is used prompt the user
for a url.
# szURL = prompt("Enter a URL:", "");
The problem is that I would like to open a php script instead of the
prompt. In that php script the user should then be able to select a
link and the information passed back to the 'szURL' variable.
If you now have
szURL = prompt("Enter a URL:", "");
// do something with szURL ...
then use instead of that
window.szURL = -1; // or any other value that indicates no selection
window.open("example.php");
function continue() {
// do something with window.szURL ...
}
and in the document your PHP script creates something like
if (opener
&& !opener.closed
&& typeof opener.continue != "undefined"
&& typeof opener.szURL != "undefined"
) {
opener.szURL = ...
opener.continue();
self.close();
}
See a similar example at
http://www.innoline-systemtechnik.de...op_opener.html
ciao, dhgm