function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Irish2013Irish2013 

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?
 
Irish2013Irish2013
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?
 
Irish2013Irish2013
I have solved the issues.
Thanks