+ Start a Discussion

anchor tag through Jscript

Hello Dev,

I'm trying to create a link in Table data in Vf page but, I'm unable to populate the same.
 var content = '<table >';     
 for(var i=0; i<defaults.length; i++){
      content += '<td>';
      content += '<a href=/+defaults[i].Id>'+defaults[i].Name+'</a>'; // Trying to make the data as a link...
      content +='</td>';
content += '</table>'; 

Td value is coming as a link but URL is coming like tes.salesforce.com/+defaults[i].Name
it's not taking the value but taking as a string, I can understand that the anchor tag is being used in single quotes.
Is there anyways we can populate this a link.
Shrikant BagalShrikant Bagal
Can you please post your whole VF code?
Hi thanks for the reply but just figured out the issues.
Shrikant BagalShrikant Bagal
Irish We are not able to figure out the issue till we will not get whole code of VF?
I have solved the issues.