JS: Validate a URL