gamoses
03-27-2002, 05:02 PM
I have a mySQL table with row titles and row descriptions. the idea is to have a list of titles with links to a javascript pop up box with full descriptions and other information. however, when the row description has certain html code (hyperlinks), it won't show the *title* correctly. naturally, the javascript doesn't work either. any ideas? here's the relevant code:
~ ~ ~ ~ ~
function PrintJavaScript() {
print "<!-- this java script takes the variables from an event shown below and opens a new window with the full information -->";
print "<script language=\"JavaScript\">\n";
print "<!--\n";
print "function desc_window(date,title,desc,time) {\n";
print " descWindow = window.open(\"\",\"EventDescription\",\"width=300,height=300,top=100,left=200,resizable=1,scrollbars=1,status=1\")\n";
print " descWindow.focus()\n";
print " descWindow.document.write('<HTML><HEAD><TITLE>'+title+'</TITLE></HEAD><BODY>')\n";
print " descWindow.document.write(\"<FONT face=arial size=2><B><big>\"+date+\"</big></B> <hr><b>\"+title+\"</b><br>\"+time+\"<br>\"+desc+\"<hr></BODY></HTML>\")\n";
print " autoClose = setTimeout(\"descWindow.close()\",30000)\n";
print "}\n";
print "-->\n";
print "</script>\n";
}
...
if ($desc) {
// pop up to description
$format_date = date ("l, F j, Y", mktime (0,0,0,$get_month,$get_day,$get_year));
$format_time = date ("g:i A", strtotime($this_time));
$format_title = addslashes($title);
$format_desc = addslashes($desc);
print "<a href=\"javascript:desc_window('$format_date','$format_title','$format_desc','$format_time')\">";
print stripslashes($title);
print "</a>";
}
~ ~ ~ ~ ~
~ ~ ~ ~ ~
function PrintJavaScript() {
print "<!-- this java script takes the variables from an event shown below and opens a new window with the full information -->";
print "<script language=\"JavaScript\">\n";
print "<!--\n";
print "function desc_window(date,title,desc,time) {\n";
print " descWindow = window.open(\"\",\"EventDescription\",\"width=300,height=300,top=100,left=200,resizable=1,scrollbars=1,status=1\")\n";
print " descWindow.focus()\n";
print " descWindow.document.write('<HTML><HEAD><TITLE>'+title+'</TITLE></HEAD><BODY>')\n";
print " descWindow.document.write(\"<FONT face=arial size=2><B><big>\"+date+\"</big></B> <hr><b>\"+title+\"</b><br>\"+time+\"<br>\"+desc+\"<hr></BODY></HTML>\")\n";
print " autoClose = setTimeout(\"descWindow.close()\",30000)\n";
print "}\n";
print "-->\n";
print "</script>\n";
}
...
if ($desc) {
// pop up to description
$format_date = date ("l, F j, Y", mktime (0,0,0,$get_month,$get_day,$get_year));
$format_time = date ("g:i A", strtotime($this_time));
$format_title = addslashes($title);
$format_desc = addslashes($desc);
print "<a href=\"javascript:desc_window('$format_date','$format_title','$format_desc','$format_time')\">";
print stripslashes($title);
print "</a>";
}
~ ~ ~ ~ ~