Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
HTML Comments Are Diamonds (Javascript) (javascriptisawesome.blogspot.com)
2 points by AltIvan on July 19, 2011 | hide | past | favorite | 5 comments


For the hard of understanding (like me), why is this particularly worthwhile?


Its excellent for in-place-non-active-at-the-start content; specially useful for images.

For example: Lets pretend you are really interested in having as few requests to the server as possible. And lets pretend you have a huge multi-content gallery (images, flash, video, etc).

So, you want a nice javascript pagination for all that; but if you just hide the pages it is gonna get loaded on the user browser, and the page is gonna get really slow.

But, if the content is inside comments the user machine only loads it when the user actually ask for it. It feels ajax-like but a little bit faster and with less petitions to the server.

Here is a script that does a little bit of that http://jsbin.com/ihepuz/2


Oh, oh, oh, oh, oh! Inside html comments. Exactly like the article says!

For some reason, when I read it the first time, my brain would not allow me to see "comment" as anything but the kind of comment that a visitor would write on a blog.

Although I must say your explanation was much more clear than the article.

Thanks so very much. :)


Gross background.


Sorry, i love it... but someday i am gonna put the option to hide it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: