Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于同一个域 AJAX,我可以使用这个:
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'):
false但是当它是跨域 AJAX 时,上面的语句会返回。检测到这一点的正确条件语句是什么?
false
谢谢
我已经检查了这个类似的问题,但它似乎没有提供好的答案