'Make a free URL shortener' webdevelopment url
There are a lot of things that are happening in this code. Let me explain you what this is. First of all we are sending a get request using. Then we are converting the response from JSON to JavaScript object. We are doing this because initially our response is in JSON format and we have to convert it into a JavaScript object to be able to use it. So we do that usingYou can also check that in your console by usingdocument.
this will create an element dynamically whenever a user requests a short link and then we will give it a class by usingmethod and set it equal to the short link from the object..prependmethod which will add the new element at the end.Now if you have followed all the steps that I mentioned, your final result will look like this. I have shared my result using
so you will be able to see all the things that I have done. And if you have missed something you can check in my code and fix the issues.