简体   繁体   English

根据屏幕分辨率(js)加载php文件

[英]Load a php file based on screen resolution (js)

Trying to load different adsense ad units based on screen resolution. 尝试根据屏幕分辨率加载不同的adsense广告单元。 So, what I've done is , i've put different adsense units into different php files, and here is a js i'm trying to use. 所以,我要做的是,我已将不同的adsense单元放入不同的php文件中,这是我要使用的js。

if ($(window).width() > 1435 ) {
        $(".adinsert1").load("../addesk1.php");
        $(".adinsert2").load("../addesk2.php");
        $(".adinsert3").load("../addesk3.php");
    }
     else  {
        $(".adinsert1").load("../admob1.php");
        $(".adinsert2").load("../admob2.php");
        $(".adinsert3").load("../admob3.php");
     }

And it doesn't display anything 而且它什么也没显示

You must first check the AdSense policies and see whether your site fulfills all their expectations. 您必须首先查看AdSense合作规范,然后查看您的网站是否符合他们的所有期望。 Next, you must make sure that you wait for a few minutes after you have first integrated the system. 接下来,必须确保在首次集成系统后等待几分钟。 If you still have a problem, then you should contact AdSense for information. 如果仍然有问题,则应与AdSense联系以获取信息。 You should check whether Javascript is enabled in the browser you are testing at and that there are no Javascript errors. 您应该检查您正在测试的浏览器中是否启用了Javascript,并且没有Javascript错误。 Also, make sure that your code for displaying AdSense ads is accurate. 另外,请确保您显示AdSense广告的代码正确无误。 Last, but not least, make sure that your JS function called load requests the server correctly, it gets the correct response and the response is correctly displayed. 最后但并非最不重要的一点是,请确保您名为load的JS函数正确地请求服务器,它会获得正确的响应并正确显示响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM