alo360 / html5rocks

Automatically exported from code.google.com/p/html5rocks
0 stars 0 forks source link

Change the way that using hash to mention tags into using search params. #806

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Related to issue 793(http://code.google.com/p/html5rocks/issues/detail?id=793).

The method we're currently using to indicate tags are putting all of them in 
hash of URL which is not good. An side effect might be issue 793, even it got 
fixed, but the behavior is really bad. You see, that if we input things like 
http://master.html5rocks.appspot.com/en/tutorials#gaming, the page will scroll 
down to the the bottom, and then, scroll to top. It doesn't look like a good 
experience.

The thing that causes the page to scroll down is there're several invisible 
<div class="page">s at the bottom of the page and, some of them own the id 
strings as same as some of tags, like "gaming", "mobile".

So when the browser sees the #gaming hash tag, it will scroll down to the <div 
class="page" id="gaming"> part. That's so bad.

We can fix that by changing all ids that have same strings as tags, or change 
the hash to be more specific that will not conflict with any element ids. But I 
don't think either of them are good enough.

I think we could get rid of using hash to indicates tags, especially we have 
already some mess code there do deal with hashchange event(look, the line 205 
and 310 inside tutsapp.js are somehow against each other.)

Using search params may be neater, the url will be look like:
http://master.html5rocks.appspot.com/en/tutorials?audience:business,gaming&tags=
canvas,webgl
Which is shorter and easier to read than our current implementation for same 
purpose:
http://master.html5rocks.appspot.com/en/tutorials#audience:business,audience:gam
ing,canvas,webgl

Original issue reported on code.google.com by han...@google.com on 9 Feb 2012 at 3:30

GoogleCodeExporter commented 8 years ago
Check issue 818 for an alternative scheme.

Original comment by han...@google.com on 14 Feb 2012 at 5:00