【发布时间】:2016-08-18 07:00:15
【问题描述】:
InnerHtml 在这种情况下不起作用,我想做这样的事情:
<table width="100%" border="0" id="table2">
<?php
include("connection.php");
$sql=mysql_query("select* from b1");
while($res=mysql_fetch_array($sql))
{
$img=$res["img"];
$url=$res["url"];
?>
<tr>
<td><script>document.body.innerHTML="<a href='"+<?php echo '$url' ; ?>.value+"'><img src='"+<?php echo '$img' ; ?>+"' / ></a>" ;</script></td>
</tr>
<?php
}
?>
</table>
【问题讨论】:
标签: javascript php html dom innerhtml