Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (23 sloc) 742 Bytes
<!DOCTYPE html>
<html>
<head>
<title>URL shortener</title>
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<form method="post" action="shorten.php" id="shortener">
<label for="longurl">URL to shorten</label> <input type="text" name="longurl" id="longurl"> <input type="submit" value="Shorten">
</form>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#shortener').submit(function () {
$.ajax({data: {longurl: $('#longurl').val()}, url: 'shorten.php', complete: function (XMLHttpRequest, textStatus) {
$('#longurl').val(XMLHttpRequest.responseText);
}});
return false;
});
});
</script>
</body>
</html>
Something went wrong with that request. Please try again.