Matt says
14 years ago
people of the interwebs - in urls such as this - arstechnica.com/gadgets/... - what does the hash do when you click on the comments bit?
latest #33
Matt says
14 years ago
Matt says
14 years ago
but I don't know what the # does? does it use PHP to generate the comments bit then go to that part of the page with a jump anchor?
Chris says
14 years ago
search hashbang if you want more info.
立即下載
Chris says
14 years ago
If you give me a bit of time to have a shower and have tea I'll post the code for my image viewer that uses them
Matt says
14 years ago
that's not a hashbang though, I don't think
Jake says
14 years ago
it's not a hash bang chris
Jake says
14 years ago
#! is a hashbang
Jake says
14 years ago
it's a bookmark, allows you to jump around using links in the same page (or other pages, and focus on the content you want to look at)
Matt says
14 years ago
thought it was that :-) cheers
Jake says
14 years ago
the ?comments=1 makes php display the contents then the #comments-bar jumps to the comments bit
Matt says
14 years ago
awesome, thanks :-)
Jake says
14 years ago
no worries :-)
Jake says
14 years ago
p.s. php cannot read hash contents
Jake says
14 years ago
the only way you can do that is to load the hash contents in javascript then ajax post them to a php file
Matt says
14 years ago
is that every really necessary?
Jake says
14 years ago
yep, I use it all the time!
Jake says
14 years ago
e.g. when I am using pagination but it ajax loads the next page
Jake says
14 years ago
I use #page=2
Jake says
14 years ago
then if somebody sends the URL to somebody else, it will load page 2
Matt says
14 years ago
Ohh, I see
Matt says
14 years ago
ahhh, I understand, so suppose you are using some AJAX, get the page to a certain state, you can use that to send that exact state to
Matt says
14 years ago
someone else using the URL?
Jake says
14 years ago
indeed! :-)
Matt says
14 years ago
awesome :-)
Matt says
14 years ago
many thanks
Jake says
14 years ago
Jake says
14 years ago
(you'll get a login prompt but:
Jake says
14 years ago
php loads the sweeney todd gallery
Jake says
14 years ago
then ajax loads the photo with id= 1678
Matt says
14 years ago
ah, I see
Matt says
14 years ago
well, that's handy
Matt says
14 years ago
very handy
back to top