weixin_33719619 2018-07-12 15:28 采纳率: 0%
浏览 37

关于Javascript的History API [重复]

This question already has answers here:
                </div>
            </div>
                    <div class="grid--cell mb0 mt4">
                        <a href="/questions/4015613/good-tutorial-for-using-html5-history-api-pushstate" dir="ltr">Good tutorial for using HTML5 History API (Pushstate?) [closed]</a>
                            <span class="question-originals-answer-count">
                                (9 answers)
                            </span>
                    </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2018-07-18 13:49:07Z" class="relativetime">2 years ago</span>.</div>
        </div>
    </aside>

now i am learning about History API modules of Javascript. Sorry for the stupid question but after i tried to read the information from web, i still can not have a very clear concept...

What is the advantages of this API and is it different between AJAX? How can we apply this api in the real applications?

Some website said that you can change the url without re-load the page! and from the w3c..

The history object contains the URLs visited by the user (within a browser window).

The history object is part of the window object and is accessed through the window.history property.

Thanks!

</div>
  • 写回答

1条回答 默认 最新

  • weixin_33739523 2018-07-17 17:26
    关注

    AJAX stands for Asynchronous JavaScript and XML. Essentially, what AJAX does is performs tasks such as making data requests or updating parts of your webpage without reloading the entire webpage (just the parts you specified).

    API stands for Application Programming Interface. APIs allow your program some sort of special information or data. In this case you are using the History API which grants you the ability to see and performs certain actions with the history (the previously visited webpages) of your browser in your current session.

    A real world use for the History API would be using the History.scrollRestoration property. When a user navigates back to a previously visited webpage that is saved in the browser's history it will also scroll the webpage down the to last place the user was before leaving that webpage. That is an example of how the History API can improve the UX (User Experience).

    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口