Live data from Hacker News

Why JavaScript web applications should embrace traditional URLs

9elements.com

11–20 of 45 posts

Re: Why JavaScript web applications should embrace traditional URLs

#11
post #10

The fundamental problem with attempting to transparently support querystrings on the client-side -- touched on a bit in this article, but not explained completely, is this: Querystrings are a server-side convention for URLs containing parameters -- the browser doesn't traditionally parse them. If you ask for document.location.search, you'll get back an opaque string containing the query part that you'll have to parse…

> now you have the possibility to have to merge two different sources of query string Not really: if hashMode and queryStringInHash parseQueryStringFromHash else parseRealQueryString You don't have to merge. Just if you modify the query string and are in "hashMode" then just push the "real querystring" elements you parsed first into the "hashquery string".

The thing is that it has to work cross-browser. If an IE user copies an URL with both a fragment query string and a real query string and then shares it with a Firefox user, the URL should resolve to the same thing (and the same thing the other way around).

Not impossible by any means, but, as Jeremy points out, it involves subtle details :)

Re: Why JavaScript web applications should embrace traditional URLs

#12

I'm getting rank sick of the growing number of websites killing the functionality of the back button. That, combined with Chromes senseless refusal to implement opening clicked urls that are on another domain in a new tab, means I'm often forced to click-and-hold the back button to get somewhere. Incredibly annoying.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

Re: Why JavaScript web applications should embrace traditional URLs

#13
post #12

I'm getting rank sick of the growing number of websites killing the functionality of the back button. That, combined with Chromes senseless refusal to implement opening clicked urls that are on another domain in a new tab, means I'm often forced to click-and-hold the back button to get somewhere. Incredibly annoying.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

I'm on a Mac, I don't have a middle mouse button.

Re: Why JavaScript web applications should embrace traditional URLs

#14
post #12

Earlier quoted context omitted.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

I'm on a Mac, I don't have a middle mouse button.

Cmd-click. On a Macbook trackpad or magic mouse you can also set three-finger tap to middle click (with third-party tweaks like BetterTouchTool).

Re: Why JavaScript web applications should embrace traditional URLs

#15
post #12

Earlier quoted context omitted.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

I'm on a Mac, I don't have a middle mouse button.

[deleted]

Re: Why JavaScript web applications should embrace traditional URLs

#16
post #12

Earlier quoted context omitted.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

I'm on a Mac, I don't have a middle mouse button.

Command-click also works.

Re: Why JavaScript web applications should embrace traditional URLs

#17
post #10

Earlier quoted context omitted.

> now you have the possibility to have to merge two different sources of query string Not really: if hashMode and queryStringInHash parseQueryStringFromHash else parseRealQueryString You don't have to merge. Just if you modify the query string and are in "hashMode" then just push the "real querystring" elements you parsed first into the "hashquery string".

The thing is that it has to work cross-browser. If an IE user copies an URL with both a fragment query string and a real query string and then shares it with a Firefox user, the URL should resolve to the same thing (and the same thing the other way around). Not impossible by any means, but, as Jeremy points out, it involves subtle details :)

Right-o. PushState-supporting users copying URLs and sending them to IE8 and IE9 folks is one thing, as is the opposite direction.

In addition, some folks currently like to mount their Backbone.js applications at a root URL that contains a query string, for example:

    todolist.com/app?org=nsa#location

Re: Why JavaScript web applications should embrace traditional URLs

#18

I'm getting rank sick of the growing number of websites killing the functionality of the back button. That, combined with Chromes senseless refusal to implement opening clicked urls that are on another domain in a new tab, means I'm often forced to click-and-hold the back button to get somewhere. Incredibly annoying.

There are a bunch of plugins to do that. It seems to me like a behaviour that's better left to a plugin.

Re: Why JavaScript web applications should embrace traditional URLs

#19
post #12

I'm getting rank sick of the growing number of websites killing the functionality of the back button. That, combined with Chromes senseless refusal to implement opening clicked urls that are on another domain in a new tab, means I'm often forced to click-and-hold the back button to get somewhere. Incredibly annoying.

I don't understand at all what you mean. To open pages in a new tab you middle click the link. Pages that automatically open in new tab are annoying. If Chrome has something that stops this, I'm extremely happy. The user should control whether a page opens in a new tab or not, and indeed the user can do that -- left click or middle click.

Ctrl-click works as well.

Re: Why JavaScript web applications should embrace traditional URLs

#20

Earlier quoted context omitted.

The thing is that it has to work cross-browser. If an IE user copies an URL with both a fragment query string and a real query string and then shares it with a Firefox user, the URL should resolve to the same thing (and the same thing the other way around). Not impossible by any means, but, as Jeremy points out, it involves subtle details :)

Right-o. PushState-supporting users copying URLs and sending them to IE8 and IE9 folks is one thing, as is the opposite direction. In addition, some folks currently like to mount their Backbone.js applications at a root URL that contains a query string, for example: todolist.com/app?org=nsa#location

Well it's les simple that I though but it's still seems doable. I'll probably try to submit a PR about that. Is there any previous PR or issue that I should rea first ?
Post reply on HN