javascript - 在不刷新页面的情况下加载另一个子域

标签 javascript subdomain

我搜索了一些不同主题的信息。在一些网站上,我注意到 url 通过滚动改变了。我不知道它的广告是否就是我将示例链接设置为代码的原因。

http://www.adweek.com/digital/post-clicks-other-clicks-are-important-metrics-for-facebook-page-admins-too/

有谁知道如何在不刷新的情况下通过 Javascript 更改 supdomain?这一面看起来像典型的 Wordpress 模板。我没有经验,也没有兴趣学习有关 wordpress 的知识。但这是在网站上产生更多点击的好方法。

我用 JS 尝试过类似的东西:

var screenHei = height settings; /*must be changed*/

$(document).ready(function(){
    $(window).scroll(function(){
        if($(window).scrollTop()>screenHei){                    
            ***change the subdomain             
        }       
    }
})

有人知道吗?并且有任何人在 SEO 方面有过该主题的经验。

最佳答案

它不使用 JavaScript 它实际上是一个 HTML5 API history.pushState()

您可以查看本教程以获取更多信息:Changing the browser-URL without refreshing page

或官方MDN page on Manipulating the browser history

关于javascript - 在不刷新页面的情况下加载另一个子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42400738/

相关文章:

php - 将 Codeigniter 项目从主域复制到子域

javascript - $.递延 : How to detect when every promise has been executed

javascript - PHP如何echo Js自定义alert

.htaccess - 使用 htaccess 将所有流量从 root 重定向到特定的子域页面

ruby-on-rails - 命名间距 Controller 时,命名空间还有什么?

Windows Azure 上的子域

javascript - 生成动态 HTML 时正确转义字符

javascript - 在类中再次将属性设置为 null

javascript - 在现有对象中添加新元素

apache2 处理子域和 SSL