javascript - How to pass/generate table with parameters from one page to another -


hi having scenario generating dynamic table along dynamic button , when ever user clicks button has row value , has generate dynamic table taking value parameter .till tried generating dynamic table , button , passed parameter function here stuck how pass /accept parameter function using ajax call can generate dynamic table.

    $.ajax({         type: 'get',         url: xxxx.xxxxx.xxxxx,         data: "id=" + clo + name_=" + cl+ "",          success: function (resp) {              var location = resp;             var tr;             (var = 0; < location.length; i++) {                  tr = tr + "<tr>                  tr = tr + "<td style='height:20px' align='right'>" + location[i].amount + "</td>";                  tr = tr + "<td style='height:20px' align='right'>" + location[i].name + "</td>";                  tr = tr + '<td><input type="button" class="nav_button" onclick="test(\'' + location[i].amount + '\',\'' + location[i].name + '\')"></td>';                  tr = tr + "</tr>";              };              document.getelementbyid('d').style.display = "block";             document.getelementbyid('wise').innerhtml = "<table id='rt'>" + "<thead ><tr><th style='height:20px'>amount</th>" + "<th style='height:20px'>name</th>""</tr></thead>"                 + tr + "<tr><td align='left' style='height:20px'><b>total:"+ totbills +"</b></td><td style='height:20px' align='right'><b></b></td></tr>" +                  "</table>";             document.getelementbyid('wise').childnodes[0].nodevalue = null;          },         error: function (e) {              window.plugins.toast.showlongbottom("error");           }    function test(value,val1,val2) {      navigator.notification.alert(value + ";" + val1 + ";" + val2);     // here have pass ajax basing on the onclick } 

so here in function have pass parameters , have display in new page , how possible ?

to pass data page best bet localstorage , sessionstorage;

sessionstorage - similar cookie expires when close browser. has same structure localstorage, there no way change permanence time, whenever closing deleted.

localstorage - similar cookie, never expires, while there records in appcache domain, variable exist (unless user creates routine remove it).

both attributes added html5. above items called web storage. there other forms of local storage through html5, such websql database, indexed database (indexdb), conventional files (file access).

ex:

// store localstorage.setitem("lastname", "smith");  // retrieve document.getelementbyid("result").innerhtml = localstorage.getitem("lastname"); 

is meant ?


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -