Saturday, September 21, 2013

Getting Page URL using Javascript

Getting Page URLs using Javascript is very useful in real life projects, it's been used by Facebook, Twitter for their share/tweet buttons, because when we click on the share button then we get the URL of the page we are browsing, and that's done using Javascript.

2 comments:

You shouldn't use .toLowerCase() for URLs. Linux and other Unix based web servers are case sensitive after the domain name, so http://example.com/ThisPage is not the same as http://example.com/thispage. Real world current example: http://wiki.centos.org/HowTos/Network/SecuringSSH works, but http://wiki.centos.org/howtos/network/securingssh gives their "not found" page.