我对Javascript很有经验,我现在调试的方式是console.log( vars ),所以我调试的方式是在程序中观察我的var,如果它们包含一些东西,一个对象等,有时也会有帮助它是浏览器中的错误日志,但这更多的是一个副作用,这种方法在javascript中对我有效,但是自从几个月以来我试图用它来调试PHP,取得的进展很小,似乎很难为此设置PHP,而且一般都有日志文件... 问:监视变量的值不是调试PHP的方法吗?如果不是,正确的方法是什么?
一个多小时的时间。这是我的index.php文件中的javascript代码。
function dostuff()
{
var thepath = document.location.search.substring(1);
alert('the path is ' + thepath + " (that's the full path)");
alert(thepath);
// TRIED THESE ALL -- NONE OF THEM WORK.
//var pathLen = String.leng
我在我的index.php:
<script type="text/javascript">
var chosenCity = 'London';
(function($) {
var formData = new FormData();
formData.append("city", chosenCity);
var xhr = new XMLHttpRequest();
xhr.open("POST", "index.