更新时间:2023-11-29 15:55:40
您必须准确地回显字符串'true'
,如果希望允许它通过,则无需执行其他操作.其他任何内容('false'
,null
,undefined
或任何字符串)都将被解释为无效,并且如果存在字符串,则将显示该字符串.
You have to echo exactly the string 'true'
and nothing else if you want it to be allowed through. Anything else ('false'
,null
,undefined
, or any string) will be interpreted as invalid and if there is a string, that string will be displayed.
因此,请仔细检查您的PHP脚本目前仅打印出'true'
或'false'
.如您所显示的脚本将打印电子邮件,后跟'true'
或'false'
.始终将其解释为false
.
So check carefully that your php script is printing out only 'true'
or 'false'
for now. The script as you've shown it prints the email followed by 'true'
or 'false'
. This will always be interpreted as false
.
阅读远程方法的文档:
该响应被评估为JSON,并且必须为true才有效 元素,可以是任何false,undefined或null(表示无效) 元素,使用默认消息;或字符串,例如那个名字是 已经采取,请尝试改为使用peter123"作为错误消息显示.
The response is evaluated as JSON and must be true for valid elements, and can be any false, undefined or null for invalid elements, using the default message; or a string, eg. "That name is already taken, try peter123 instead" to display as the error message.
使用Firebug或Chrome Inspector验证您的响应正确无误.
Use Firebug or Chrome Inspector to verify that your response is correct.