Made the javascript compatible with all site URL's (previously it was hardcoded for testing purposes)