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

WBOY
Release: 2016-07-25 08:52:05
Original
1238 people have browsed it
  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. }
复制代码


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template