Make the javascript respect fragments