Javascript 自动下载目标url的php脚本
我有一个脚本,每次单击按钮都会打开一个子窗口。问题是,它会下载PHP脚本。如果子窗口打开,如何防止PHP脚本自动下载?提前谢谢 下面是将打开新窗口的示例代码Javascript 自动下载目标url的php脚本,javascript,php,Javascript,Php,我有一个脚本,每次单击按钮都会打开一个子窗口。问题是,它会下载PHP脚本。如果子窗口打开,如何防止PHP脚本自动下载?提前谢谢 下面是将打开新窗口的示例代码 <script> $('#btnShow').click(function(){ var myLog = document.getElementById('txtLog').value; window.open("/sample/sample.php?login="+myLog,"child
<script>
$('#btnShow').click(function(){
var myLog = document.getElementById('txtLog').value;
window.open("/sample/sample.php?login="+myLog,"child","width=800,height=600");
}
</script>
$('#btnShow')。单击(函数(){
var myLog=document.getElementById('txtLog').value;
window.open(“/sample/sample.php?login=“+myLog,”child”,“宽度=800,高度=600”);
}
$(“#btnShow”)。单击(function(){var myLog=document.getElementById('txtLog').value;window.open(“/sample/sample.php?login=“+myLog,”child”,“width=800,height=600”);}是否在服务器中运行php文件?