Home >Backend Development >PHP Tutorial >zf method to determine whether the request comes from the XMLHttpRequest object

zf method to determine whether the request comes from the XMLHttpRequest object

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 08:52:051267browse
  1. /*
  2. * * Is the request a Javascript XMLHttpRequest?
  3. * * Should work with Prototype/Script.aculo.us, possibly others.
  4. * * @return boolean
  5. */
  6. public function isXmlHttpRequest() {
  7.     return (
  8.     $this->getHeader('X_REQUESTED_WITH') == 'XMLHttpRequest');
  9. }
复制代码


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn