How to refresh the URL in the address bar when loading pages through Ajax

Source: Internet
Author: User

Recently, an online user asked me about the problem of playing audio streams across regions.

After searching on the internet, IFRAME is actually used, and Ajax is actually used.

Although these two methods can be used to refresh the audio player without refreshing the new audio player, IFRAME/Ajax is used. In this way, even when you update the website, it will not stop.

However, even if the speaker can bypass the entire site, the URL does not change in the address.

My mind is to follow Facebook's instructions and use internal scripts to change the URL.

You only need to replace the following statement:Location. Replace ("# ABC. aspx ");

You can replace the URL after "#" into the URL of the address you requested Using ajax/iframe. To the end, this is just to change the URL address using a token.

I do not recommend the above functions because sharing a URL for all the faces is not conducive to search engine receiving. At this point, the function allows you to play audio streams across regions.

The better way is to add the history. pushstate method to HTML5 to add historical records to the browser, but does not trigger page loading. This is to be broken down next time.

Add ASP to the Group for more web development technologies. net advanced group number: 261882616 bloggers and colleagues discuss topics of interest with you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.