Solution 1 :

You might want to replace the href='#' attribute with url.

Replace the line before the comment with this line

$("#news").append("<a href='" + url +"' id = 'url'>" + url + "</a>");

Hope this works!

Solution 2 :

Please put the URL in your a tag when you append it in I’d news. Seems that you put a # only instead of a exact url. That’s why it keeps refreshing the page every time you clicked it. See code below

$("#news").append("<a href='" + url +"' id = 'url'>" + url +</a>");

Problem :

enter image description hereI am using get method to fetch the data from third-party API and I am appending to list its working well but when I click the link it’s reloading and it’s not redirecting the URL link


Comment posted by Shehroz Altaf

Is it appending data properly?