How to wrap the expanded link with <a href>?


$.get(urlToExpand, response => {
  $responseField.append('<p>Your expanded url is: </p><a href="javascript:response.longUrl"><p>' + response.longUrl + '</p></a>')
}, 'json');

Is there a way to do it?


Do you really want your app to be a referrer that will show up in access logs of all the linked to sites?

'<p> Your expanded URL is </p><p><a href="' + jsonResponse.longUrl + '">' + jsonResponse.longUrl + '</a></p>'


I just wanted to try something new. I didn’t have anything in mind other than experimentation.

Which I couldn’t do it anyway because I’m too incompetent to do something as simple as that.


We all start out that way. Go easy on yourself and take every mistake as a step forward. No matter how long we do this stuff we make mistakes. It’s how we humans learn.