代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="gb2312">
<title>Document</title>
</head>
<body>
<p id="aa"> Hello </p>
<?php
$link=mysql_connect('localhost', 'root', '12345');
if(!$link) {
$text='Could not connect: ' . mysql_error();
echo "<script> window.parent.document.getElementById('aa').innerText= '$text'; </script>";
}
?>
</body>
</html>
问题点:mysql_connect故意出错,为什么aa的文本不会变化呢?还是Hello?
打印打印$text:
Could not connect: Access denied for user 'root'@'localhost' (using password: YES) 
新人请各位多多赐教,谢谢