Catalogue
A JS Snippet That Automatically Shortens URLs as You Type Them into an Input Box

A JS Snippet That Automatically Shortens URLs as You Type Them into an Input Box

🌐 日本語で読む

[f:id:kenzo0107:20160310115924p:plain]

Overview

Lately, more and more cases use Japanese characters in URLs.

Whether this is worthwhile from an SEO perspective is debatable, but for users who are less familiar with the internet, it might make for a more intuitive UI.

There was a blog post discussing this point.

When developing social-integration tools that, for example, post URLs containing Japanese characters to Twitter, you have to pay strict attention to the character count. I automated the shortening process using the bitly API, so this is a write-up of that.

Steps

  • Load the following js in your HTML or wherever appropriate.

That’s all.

kenzo0107

kenzo0107