JQuery-动态创建表并添加锚标记不会将锚显示为链接

我是Jquery的新手。

我有一个获取数据和链接的ajax调用。 我必须在动态创建的表中显示该数据。 在每个表行中,我需要显示带有锚标记的url。

我面临的问题是:

添加锚标记未显示为链接,因为锚标记是动态创建的,并且链接不起作用。

$('#jsp-data-header').append('Functionalities of the Resource'); $('').appendTo($('#jsp-data-header')) .append($('').text('JSP files')) .append($('').text("https://stackoverflow.com/questions/17817285/jquery-creating-a-table-dynamically-and-adding-a-anchor-tag-is-not-showing-anch/"+tempurl+"")); 

如何使它显示为链接并单击链接shouls带我到提到的URL。

请建议。

试试这个 –

  $('#jsp-data-header').append('Functionalities of the Resource'); $('').appendTo($('#jsp-data-header')) .append($('').text('JSP files')) .append($('').html("https://stackoverflow.com/questions/17817285/jquery-creating-a-table-dynamically-and-adding-a-anchor-tag-is-not-showing-anch/"+tempurl+"")); 

这是一个jsFiddle ,由Jason Sperske提供