广告拦截器阻止 Ajax 调用响应 html [英] Ad blocker blocks Ajax call response html

查看:35
本文介绍了广告拦截器阻止 Ajax 调用响应 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的页面上呈现一些统计信息,因为这需要一些时间我在页面加载后将此请求作为ajax调用

    <script type ="text/javascript">
    $(document).ready(function () {   
        $.ajax({
            url: '@Url.RouteUrl(Routes.MyAds.AjxCallFoAbc, new {advertId = Model.CreateAdvertHeader.SelectedAdvert.Id})',
            type: 'GET',
            cache: false,
            success: function(response) {
                $('.advert-performance').replaceWith(response);
            }
        });
    });
</script>

这对我来说非常有效,当用户安装广告拦截器时它会引起悲伤,此内容被阻止,我已经调试了代码库并发现广告时永远不会命中 ajax 调用路由-在浏览器上启用拦截器

解决这个问题的方法是什么,即使安装了广告拦截器,我也需要显示统计数据

What is the work-around for this, I need show the stats even if the ad-blocker is installed

推荐答案

已解决

原因是,我的 ajax 指向的路由有一个 advert-stats 作为 URL 的一部分,这导致阻止程序阻止它,只需更改路线即可修复它

The reason being, my route which the ajax was pointed to had a advert-stats as part of the url, which caused the blocker to block it, simply changing the route has fixed it

这篇关于广告拦截器阻止 Ajax 调用响应 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆