What happens when you have a speakerdeck presentation that is named "slideshare.net"? Speakerdeck puts the deck name in the URL. You need something better than ``indexOf`` to test for URL. Try this approach: http://stackoverflow.com/questions/3213531/creating-a-new-location-object-in-javascript