[LUGOS-PROG] javascript + php

Matej Kovacic matej.kovacic at uni-lj.si
Thu Feb 28 13:16:11 CET 2002


Ziv!

> namesto \" dal \\\" - najprej escape iz PHPja, nato pa se iz JavaScripta.
To sem medtem ze ugotovil, ja, treba je dati \\\.
Še vedno pa ne dela tisti clearTimeout.

Tukaj posiljam celotno kodo - HTML. Samo skopiras v HTML file in pozenes.
ClearTimeout Ne
deluje.


<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popupWin() {
text =  "<html>\n<head>\n<title>Obvestilo</title>\n<body>\n";
text += "<center>\n";
text += "<font face=Verdana size=2>Klikni:<br></font>";
text += "<button type=\"button\"
onclick=\"clearTimeout()\"><b>STOP!</b></button></center>\n</body>\n</html>\
n";
setTimeout('windowProp(text)', 1000); 		// delay 1 second before opening
}
function windowProp(text) {
newWindow = window.open('','newWin','width=300,height=150');
newWindow.document.write(text);
setTimeout('closeWin(newWindow)', 5000);	// delay 5 seconds before closing
}
function closeWin(newWindow) {
newWindow.close();				// close small window and depart
}
//  End -->
</script>

</HEAD>

<BODY onLoad="popupWin()">

<center>
This demo will open a small popup window 3 seconds after the page is loaded
and
close the window after it has been open for 5 seconds.
</center>

lp, M.




More information about the lugos-prog mailing list