我嘗試使用window.open,但到目前爲止它不工作PHP和Javascript打開的窗口功能
<script type="text" language="javascript">
function win1(j){
window.open("ctry.php?j=" + j,"Window1","menubar=no,width=460,height=360,toolbar=no");
}
</script>
<?php
for($j = 1; $j <= 2; $j++){
?>
<a href="javascript:win1('<?php echo $j;?>')"
onMouseOver="self.status='Open A Window'; return true;"><b>Open Window</b></a>
<?php
}
?>
當我點擊鏈接什麼都沒有發生,並在控制檯上我得到這個錯誤:
Uncaught ReferenceError: win1 is not defined
你知道我能做什麼嗎? 感謝
請查看此頁面其可以幫助你 http://stackoverflow.com/questions/6103770/open-a-php-page-from-javascript-function – Zeshan