0

我有一个通过 PHP 代码生成的 ListView:

   <?php do { ?> 
   <tr>
       <td width="20"><a href="edit_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>"> <img src="./images/small_pencil.png" /></a></td>
       <td width="20"><a href="view_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>"> <img src="./images/small_eye2.png" /></a></td>
       <td width="20">
         <form name="properties" method="post" action="properties.php?search=<?php echo $row_rsProperties['ms_address']; ?>">
           <button type="submit" name="properties"> <img src="./images/newsletter.png" /> </button>
         </form>
       </td>       
       <td width="250"><?php echo $row_rsProperties['ms_address']; ?></td>
       <td width="140"><?php echo $row_rsProperties['ms_city']; ?></td>
       <td width="140"><?php echo $row_rsProperties['ms_state']; ?></td>
       <td width="60" align="center"><?php echo $row_rsProperties['ms_zip']; ?></td>
       <td width="250"><?php echo $row_rsProperties['ms_mm_owner1']; ?></td>
       <td width="250" align="center"><?php echo $row_rsProperties['owner_phone1']; ?></td>
       <td width="250" align="center"><?php echo $row_rsProperties['expired']; ?></td>
       <td width="250" align="center"><?php echo $row_rsProperties['fsbo']; ?></td>
       <td width="250" align="center"><?php echo $row_rsProperties['ms_status']; ?></td>
   </tr>
   <?php } while ($row_rsProperties = mysql_fetch_assoc($rsProperties)); ?>

如何点击编辑或查看锚点以在窗口中打开(在身份验证后通过 javascript 代码打开?

PHP 文件(在加载主菜单时执行):

<body onLoad="openDetailWindow()">

Javascript src .js 文件功能:

function openDetailWindow() {
    window.open("_blank.php","LMS - Record Detail","fullscreen=0,menubar=0","false");
}
4

1 回答 1

0

在锚标记内放置以下代码:

onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"

所以,现在标签现在如下所示:

<td width="20"><a href="edit_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>" onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"> <img src="./images/small_pencil.png" /></a></td>
于 2013-08-07T19:13:45.633 回答