Coding 2short url (JavaScript)