Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
an exapmple of the rebrandly API ising jQuery (ancient)
<!doctype html>
<input id="box">
<button onclick="makelink(document.getElementById('box').value);">Make link</button>
<div id="output"></div>
<script src="">
var data;
function makelink(q) {
"" +
q +
success: function (rawdata) {
var rawstring = JSON.stringify(rawdata);
data = JSON.parse(rawstring);
document.getElementById("output").innerHTML =
"<a href='https://" +
data.shortUrl +
"' target='_blank'>" +
data.shortUrl +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment