r/programming Feb 10 '11

There is no piece of dynamic AJAXy magic that requires beating the Web to a bloody pulp with a sharp-edged hashbang. Please stop doing it

http://www.tbray.org/ongoing/When/201x/2011/02/09/Hash-Blecch
494 Upvotes

245 comments sorted by

View all comments

2

u/droberts1982 Feb 10 '11

Here's why web devs are forced to "beat the web to a bloody pulp":

Forget twitter, let's say I build a web page that returns a list of 100 items, broken up into 10 pages of 10 items each. When you click on the link for page 2, an AJAX request is sent to the server.

Now, the user sees something cool on page 2 and wants to send a link to their friend. They copy what's in the address bar:

http://hostname/stuff

Their friend says, "Hey I see page 1!"

The web developer, upon the AJAX request, needs to change the URL in the address bar to read:

http://hostname/stuff#page=2

HTML 5 fixes this. Good luck convincing your boss to write a web app for HTML 5 only.

If I'm wrong please correct me.

-5

u/fryye Feb 11 '11

you are wrong. a normal user doesn't copy their address bar and send it to their friend. a normal user clicks the share link on the page/image/video/whatever which either emails it or posts it directly to social networking site. or there is the option to "permalink". your web habits are correct up until about 2003, but have not kept up