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


#1

https://www.codecademy.com/courses/intermediate-javascript-requests/lessons/requests-i/exercises/ajax-requests-get-method?action=lesson_resume&course_redirect=introduction-to-javascript

$.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?


#2

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>'

#3

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.


#4

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.


#6