Ideal for continuous music playback through page loading? Using javascript to load pages

I am developing an online magazine. We have an html5 / flash player, and this is the main part of the website. But the site also has many articles and more. So basically, I want the playback of seamless music files on different pages to load, but I also want to avoid the full javascript application, because I want all the content to be friendly and indexable on Google.

I use the html5 api history with hashbang (#!) Abstracting to load various content on the main page when clicked. And the loaded URLs also point to content pages.

For example: The munimkazia.com/page1.html link on my munimkazia.com index page will download content from page1.html and embed it. The url will change to munimkazia.com/#!/page1.html in firefox and IE and munimkazia.com/page1.html in chrome .. Since the href link is munimkazia.com/page1.html, the spider will follow the link and receive content I have a page configured correctly on page1.html, ready for viewing. But now I have a problem.

If I decide to use ajax loads on this page, the URLs displayed on the browser location bar will not match the hashbang fallback element (http://munimkazia.com/page1.html/#!/page2.html) If I decide redirect all clicks to the main page of the container at http://munimkazia.com and load page2.html, after that everything will work fine, but this loading of the page will interrupt the music playback before it, if any.

In addition, I do not want to rewrite all http://munimkazia.com/page1.html to http://munimkazia.com/#!/page1.html because I want all the content to be present and not to be downloaded and written by javascript for reading by search engine spiders. I know that Google has a specification for reading C # content! URL, but I want the page to load with the content of the article for the user, even if JS is disabled.

Any ideas / tips / workarounds?

Edit: These URLs are just examples to explain my point. No javascript code to retrieve pages at munimkazia.com

+4
source share
1 answer

Hash-bang #! The URL can be indexed by Google, and it’s all the same, otherwise people will just use the hash # on their own.

I think the idea is what Google sees #! URL and converts it to a querystring parameter, for example. example.com/#!/products/123/ipod-nano-32gb becomes example.com/?_escaped_fragment_=/products/123/ipod-nano-32gb , but users still use the hash url. Are you programming a server to respond to a parameter? _escaped_fragment_, but the JavaScript user is redirected to the correct #! URL

Check out the Google spec here http://code.google.com/web/ajaxcrawling/docs/getting-started.html

I don't think it's nice to use both types of URLs, since you would have two URLs hosted on blogs, Twitter, etc. users for the same page would also be a nightmare for writing code to reliably handle this. You will probably have to be content with hashing until the HTML5 history API is more widely supported.

+3
source

Source: https://habr.com/ru/post/1339953/


All Articles