您现在的位置是:判断是否为Ajax请求
判断是否为Ajax请求
PHP
if(isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"])=="xmlhttprequest"){ // ajax 请求的处理方式 }else{ // 正常请求的处理方式 };
JS
var xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","test.php",true); xmlhttp.setRequestHeader("X-Requested-With","XMLHttpRequest"); xmlhttp.send();
随便看看
- Cacti配置远程MySQL
- PHP获取当前页面url
- MySQL(root用户)密码重置
- 微信html弹出点击右上角分享到朋友圈
- PHP常用的header头部定义汇总
- php接收json或者xml数据
- 构建微信公众号被动回复news多图文消息xml
- 构建微信公众号被动回复image图片消息xml
- Apache禁用TRACE Method和添加X-frame-options响应头
- 从MySQL日志中恢复数据
- Binary file (standard input) matches
- ajax后台定时获取数据
- Apache设置浏览器默认编码
- The InnoDB memory heap is disabled
- Linux修改密码提示passwd /usr/share/cracklib/pw_dict: error reading header
站长简介
分类
最新文章
热门文章
- 微信支付退款结果通知解密
- 到ICANN投诉三五互联获取域名转移密码成功
- Linux修改密码提示passwd /usr/share/cracklib/pw_dict: error reading header
- {"errcode":45047,"errmsg":"out of response count limit hint]"}
- 微信html弹出点击右上角分享到朋友圈
- Apache禁用TRACE Method和添加X-frame-options响应头
- PHP将B转换为KB、MB、GB
- 构建微信公众号被动回复image图片消息xml
- mysqld_safe Number of processes running now
- CentOS使用chkconfig提示systemctl enable xxxx.service