javascript - how to set the data retrieved from the database as the div content? -


coding retrieving data..

script

 function querysuccess(tx, results)              {                     var len = results.rows.length;                     console.log("demo table: " + len + " rows found.");                     (var i=0; i<len; i++)                     {                         console.log("row = " + + " name= " + results.rows.item(i).name+ " address=  " + results.rows.item(i).address+ " roll_no= " + results.rows.item(i).roll_no);                         document.getelementbyid("list_view").innerhtml  = results.rows.item(i).name;                     }             } 

html

 <div id="list_view" style="float:left; width:100%; padding:0px; margin:0px;">                 <ul style="float:left; width:100%; list-style:none; padding:0px; margin:0px;">                     <div style=" border-bottom-color:#cccccc; border-bottom:ridge; "> <li style="font-size:18px"></li></div>                 </ul>             </div>     </body> </html> 

am correct?? *how set data retrieved database div content?*

document.getelementbyid("list_view").innerhtml  = results.rows.item(i).name; 

becomes

document.getelementbyid("list_view").innerhtml  = results.rows.item(i).name; 

p.s. see

<divid="list_view"...> 

maybe it's accidental error here on so, try check if 'id' separated 'div' , not 'divid'


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -