Domanda

What is the correct syntax to use for an AJAX deep link? I am using jQuery Address.

I have seen the following methods:

http://example.com/#Contact
http://example.com/#/Contact
http://example.com/#!/Contact

Which one is better, and why?

È stato utile?

Soluzione

That depends what it is you're trying to do?

The last one is a hashbang, and if you structure your site correctly that would also serve proper content for Google.

In other words, this ajax link:

http://example.com/#!/Contact

would be converted by Googlebot to:

http://example.com/?_escaped_fragment_=Content

And when that page is visitied you should serve up the same content as on the ajax driven page, but without ajax so Googlebot can read it.

There's more here

Other than that, it makes no difference what you use, as long as it works

Altri suggerimenti

http://example.com/#!/Contact is the best , don't know why but google consider it as a unique url

That depends on your implementation, but I would prefer to use real URLs without hashtags. There are techniques to manipulate the url without reloading. That is called pushState see also the MDN: https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Manipulating_the_browser_history

So you can speedup the load of your page, but you need to implement that also on the server side to give the correct response. However that is better to li.k for the users.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top