字符串我想创建一个拥有动态PHP页面 为插入<?PHP的到PHP文件
newwindow=window.open();
newdocument=newwindow.document;
newdocument.write(HTMLstring);
newdocument.close();
功能的JavaScript字符串。 当我尝试插入页面的第一部分,它启动一个PHP块
HTMLstring+='<?php';
HTMLstring+='echo "this should print";';
HTMLstring+='?>';
我试图启动与
HTMLstring+='<\?php';
,但我得到
<!--?phpecho "this should print";?-->
是有方法在JavaScript中做到这一点?
谢谢
JavaScript运行在客户端,PHP是一种服务器端语言,这是行不通的,你试图通过这样做来完成什么? – 2011-12-20 22:17:57