1

I'm looking for having urls like http://example.org/!#/followers and http://example.org/!#/following in my django application.

All plugin like jquery history plugin, jQuery BBQ and others, teach how to have urls like this http://example.org/#followers and http://example.org/#following.

I want !#, is this possible?

Thanks.

Fred Collins
  • 4,664
  • 14
  • 58
  • 108

3 Answers3

1

Hash bangs are bad. Bad for your application and bad for the web. Use the pushstate api to achieve the similar effect in supported browsers. You can even use the awesome jquery-pjax

The part of the URL that is after # is not even sent to the server. In the page, you hookup the JS to send a AJAX request and load the particular div, from the real URL your server gives that content from.

Community
  • 1
  • 1
Lakshman Prasad
  • 76,135
  • 46
  • 128
  • 164
0

First of all, a clarification ... do you want bang-hash (!#), or hash-bang (#!)? The latter is the common url scheme for AJAX-ified sites that Google uses to index varying states in a web application. However, it isn't something you can build into a Django URL scheme, because the hash signifies to the browser that what follows is a URL fragment, so it doesn't get sent the same way to your Django engine. It's really a structure for javascript (as you point out, jquery) rather than for any sort of backend processing.

jlmcdonald
  • 12,497
  • 2
  • 45
  • 59
0

I've solved with jquery-history.

Fred Collins
  • 4,664
  • 14
  • 58
  • 108
  • how did you achieve this with jquery history?? ive been looking for a way to do this for a while – Ricki Jun 16 '11 at 22:01
  • yea but theres no docs on making it applicable for Google AJAX Crawling methods and i cant seem to figure this one out.. im using jQuery Address ATM and its sprouting all sorts of problems – Ricki Jun 17 '11 at 19:56
  • Found and excellent source on [how to make ajax content crawlable by google bot?](https://developers.google.com/webmasters/ajax-crawling/docs/getting-started) – Vikas Gulati Dec 17 '12 at 14:12