【发布时间】:2014-08-04 04:47:10
【问题描述】:
我的功能是:
<head>
<script type="text/javascript">
// Info popup window
function showInfo(infFilename) {
alert(infFilename);
popupWin = window.open('notes/"+infFilename+"','open_window','width=400,height=300,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=20,top=20' );
}
</script>
</head>
调用弹窗的php代码是:
<?php>
// check if metadata exists ( PicNotes is "filename.php" )
if ($row['PicNotes']) {
$icon = "<img src = \"images/info.png\" onClick=\"showInfo($row[PicNotes])\" />";
}else{
$icon='';}
echo "<a href='images/".$row['vfile']."' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>".$row['Title']."</b><br />".$row['Medium']." ".$row['iw']." x ".$row['ih']." cm. $icon'><img border='1' src='images/".$row['tnfile']." ' alt=' ' width='".$row['tnx']."' height='".$row['tny']."' class='tn' /></a><br />";
?>
这一行的html是(来自查看源代码):
<a href='images/0712120189y.jpg' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>Broken Bridge in Water Meadow</b><br />Gouache & Pastel 24 x 19 cm. <img src = "images/info.png" onClick="showInfo(wm_series.php)" />'><img border='1' src='images/0712120189z.jpg ' alt=' ' width='96' height='75' class='tn' /></a>
请有人看看我做错了什么。
【问题讨论】:
-
showInfo('wm_series.php')需要在名称周围加上引号。 -
查看
<img元素的HTML。您在showInfo的参数周围缺少引号。
标签: javascript xhtml