tidying
This commit is contained in:
parent
d4bab117da
commit
708cf03dec
@ -4,7 +4,7 @@ function shorten(){
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: { url: $('#url-field').val() },
|
||||
success: function(data){
|
||||
success: data => {
|
||||
console.log('data', data);
|
||||
const $link = $('#link');
|
||||
const resultHTML = `<a class="result" href="${data.shortUrl}">${data.shortUrl}</a>`;
|
||||
@ -15,12 +15,12 @@ function shorten(){
|
||||
});
|
||||
}
|
||||
|
||||
$("#url-field").keyup(function(event){
|
||||
if(event.keyCode === 13){
|
||||
$("#btn-shorten").click();
|
||||
}
|
||||
$('#url-field').keyup( (event) => {
|
||||
if(event.keyCode === 13)
|
||||
$('#btn-shorten').click();
|
||||
|
||||
});
|
||||
|
||||
$('#btn-shorten').on('click', function(){
|
||||
$('#btn-shorten').on('click', () => {
|
||||
shorten();
|
||||
});
|
Loading…
Reference in New Issue
Block a user