我有这个在我的的index.phpJavaScript并没有在我的PHP代码工作
include 'app/Core.php';
echo Core::getPageHtml();
在core.php中
final class Core
{
public static function getPageHtml()
{
ob_start();
include 'layout.php';
$html = ob_get_clean();
return $html;
}
}
layout.php中是正常的HTML代码,我可以看de页面,只是完美的,但JavaScript代码不起作用,我甚至写了一个警报('hello world'),像这样
<script type="text/javscript">
alert('hello world');
</script>
所以,它应该很简单,但我可以让它工作,我在这里失踪了什么? 需要一些帮助,这代码
你确定'layout.php'被包含在内(可能是错误的路径,或者是什么..)?试着用'echo' alert('x');'“;'看看它是否有效 – acm 2010-11-08 14:52:58