对于第 3 方 Open X Server,如果他们的站点出现故障,我们如何阻止它尝试加载?

发布于 2024-09-27 12:55:13 字数 1770 浏览 6 评论 0原文

下面的代码是正在投放的广告。由于广告位于页面的最顶部,因此我们希望确保即使服务器发生故障,它也不会阻止网站加载。我们正在寻找 JavaScript 或 C# ASP.NET 解决方案。我们尝试重写它以在 DOM Ready 上工作,但它似乎并不那样工作。

<!--LEADERBOARD AD-->
    <center>
    <div>
    <script type='text/javascript'><!--        //<![CDATA[
        var m3_u = (location.protocol == 'https:' ? 'https://www.oncampusweb.com/delivery/ajs.php' : 'http://www.oncampusweb.com/delivery/ajs.php');
        var m3_r = Math.floor(Math.random() * 99999999999);
        if (!document.MAX_used) document.MAX_used = ',';
        document.write("<scr" + "ipt type='text/javascript' src='" + m3_u);
        document.write("?zoneid=341");
        document.write('&amp;cb=' + m3_r);
        if (document.MAX_used != ',') document.write("&amp;exclude=" + document.MAX_used);
        document.write(document.charset ? '&amp;charset=' + document.charset : (document.characterSet ? '&amp;charset=' + document.characterSet : ''));
        document.write("&amp;loc=" + escape(window.location));
        if (document.referrer) document.write("&amp;referer=" + escape(document.referrer));
        if (document.context) document.write("&context=" + escape(document.context));
        if (document.mmm_fo) document.write("&amp;mmm_fo=1");
        document.write("'><\/scr" + "ipt>");
    //]]>--></script><noscript><a href='http://www.oncampusweb.com/delivery/ck.php?n=ae7029e9&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://www.oncampusweb.com/delivery/avw.php?zoneid=341&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae7029e9' border='0' alt='' /></a></noscript>
    </div>
    </center>
    <!--LEADERBOARD AD-->

The code below is the ad that is being served. Since the ad is at the very top of the page, we want to make sure that it doesn't stop the site from loading if their server happens to go down. We are looking for either a javascript or C# ASP.NET solution. We have tried rewriting it to work on DOM Ready, but it does not seem to work that way.

<!--LEADERBOARD AD-->
    <center>
    <div>
    <script type='text/javascript'><!--        //<![CDATA[
        var m3_u = (location.protocol == 'https:' ? 'https://www.oncampusweb.com/delivery/ajs.php' : 'http://www.oncampusweb.com/delivery/ajs.php');
        var m3_r = Math.floor(Math.random() * 99999999999);
        if (!document.MAX_used) document.MAX_used = ',';
        document.write("<scr" + "ipt type='text/javascript' src='" + m3_u);
        document.write("?zoneid=341");
        document.write('&cb=' + m3_r);
        if (document.MAX_used != ',') document.write("&exclude=" + document.MAX_used);
        document.write(document.charset ? '&charset=' + document.charset : (document.characterSet ? '&charset=' + document.characterSet : ''));
        document.write("&loc=" + escape(window.location));
        if (document.referrer) document.write("&referer=" + escape(document.referrer));
        if (document.context) document.write("&context=" + escape(document.context));
        if (document.mmm_fo) document.write("&mmm_fo=1");
        document.write("'><\/scr" + "ipt>");
    //]]>--></script><noscript><a href='http://www.oncampusweb.com/delivery/ck.php?n=ae7029e9&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://www.oncampusweb.com/delivery/avw.php?zoneid=341&cb=INSERT_RANDOM_NUMBER_HERE&n=ae7029e9' border='0' alt='' /></a></noscript>
    </div>
    </center>
    <!--LEADERBOARD AD-->

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

复古式 2024-10-04 12:55:13

我依稀记得几年前也遇到过类似的问题。我所要做的就是将广告加载到页脚中。这样,您的页面将始终加载。当然,缺点是页面完全加载后才会显示。

I vaguely remember facing a similar problem I had a few years ago. What I had to do was load the ad in the footer. That way, your page will always load. Of course, the downside is that it won't display until the page is fully loaded.

几味少女 2024-10-04 12:55:13

只需在我们的 SQL 服务器中创建一个位,如果网站加载失败,可以翻转该位。这将阻止网站尝试加载广告。

Simply just created a bit in our SQL server that could be flipped if the site was failing to load. This would stop the site from trying to load the ad at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文