加载另一个子域而不刷新页面

时间:2017-02-22 19:38:28

标签: javascript subdomain

我搜索了一些不同主题的信息。在某些网站上,我注意到滚动更改了网址。我不知道它的广告是否为什么我将examplelink设置为代码。

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             
        }       
    }
})

有人有想法吗?并且有任何人通过搜索引擎优化与该主题的经验。

1 个答案:

答案 0 :(得分:2)

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

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

或官方MDN page on Manipulating the browser history

相关问题