Create HTML table with hyperlink from JSON Object
<p>I have an application which returns a JSONObject. I am able to get data from JSON object using below code.</p>

<hr>

<pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0  Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
    &lt;head&gt;
    &lt;style type="text/css"&gt;


table, td, th
{
border:1px collapse black;
font-family:Arial;
font-size :small;
}
th
{
background-color:green;
color:white;
}
.hideMe
{
    /*display : none;*/
    /*visibility: hidden;*/
}

&lt;/style&gt;
   &lt;script type="text/javascript" language="jscript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"&gt;   
   &lt;/script&gt;
   &lt;script type="text/javascript" language="javascript"&gt;
           var host = "somehost";
           var mystr = "http://"+ host  +"/rest/bpm/wle/v1/exposed/process";   // use get for this
           var ulink = "";

           $(document).ready(function () {
           $.get(mystr, function (data) {
                   var obj = JSON.parse(data);
               var thtml = "&lt;table id='proctable'&gt;";

                   for (i = 0; i &lt; obj.data.exposedItemsList.length; i++) {
                       ulink = "http://" + host + obj.data.exposedItemsList[i].startURL;
                       thtml = thtml + "&lt;tr&gt;&lt;td&gt;&lt;a onclick='my_function()' href='javascript:void(0)'&gt;" + obj.data.exposedItemsList[i].display + "&lt;/a&gt;&lt;/td&gt;&lt;td id='linkcell' class='hideMe'&gt;" + ulink + "&lt;/td&gt;&lt;/tr&gt;";                   
               }
               thtml = thtml + "&lt;/table&gt;";
               document.getElementById('contentdiv').innerHTML = thtml;
           });
       });

       //javascript 
       my_function = null;

       //jquery
       $(function () {
           function generateBPDInstance() {
               $.post(ulink, function (taskdata) {
                   var tobj = JSON.parse(taskdata);
                   alert(tobj.data.tasks[0].name);
                   alert(tobj.data.tasks[0].tkiid);                  
               });
           }
           my_function = generateBPDInstance;
           ulink = "";
       })
`

   &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
 &lt;form name="myform"&gt;           
            &lt;div id="contentdiv"&gt;
            &lt;table id="proctable"&gt;
            &lt;/table&gt;
            &lt;/div&gt;
        &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<hr>

<p>The above html creates a table showing a list of the returned values. I also want to get rowIndex of hyperlink and pass value of column2 to function generateBPDInstance.</p>

<p>I am not so good at HTML and Jquery. Please suggest how can I get rowIndex for HTML table which is created through javascript.</p>

<p>Thanks in advance.</p>
