So i'm trying to get the href code to be a clickable button. So far i'm just trying to make it as a link!
Heres the code
$("table").append("<tbody><tr><td>"+title+"</td><td><a href='"+href+"'></a></td></tr></tbody>");
The JSON pulled back a Href
link, All I want is to have a tabled button that says link
and redirects the page using the link from the json.
Sam
You need to do two things:
var button = "<button class='redirect-button' data-url='"+href+"'>Link</button>";
$("table").append("<tbody><tr><td>"+title+"</td><td>"+button+"</td></tr></tbody>");
$("table").find(".redirect-button").click(function(){
location.href = $(this).attr("data-url");
});