how to display the data in table format using javascript...data is read from the xml file and here in the below code wat i mentioned.... instead of displaying the message as it is i need to display the coresponding field data in the format of table.
I have some six fields like name,last,open,low ,high,chrg...
Help me out in doing this...
function broadcastListener(msg) {
for(int i=0;i<1000;i++)
{
console.log("received broadcast: " + msg + ", " + msg.data[i]);
$(<'<tr>')
$('<td>').html(msg.data[i]).prependTo('#contentList').animate({color: "#000000"}, 6000);
$('<tr>')
}
$('html, body').animate({ scrollTop: 0 }, 0);
}
google.load("jquery", "1");
/**
* Callback function - Cometd consumer.
*/
google.setOnLoadCallback(function() {
$.getScript("http://jquerycomet.googlecode.com/svn/trunk/jquery.comet.js", function(){
console.log("done loading js");
$.comet.init("http://localhost:9099/cometd");
$.comet.subscribe("/broadcastMessageChannel", broadcastListener);
});
});
/**
* Listener function called on receipt of broadcast message.
*/
function broadcastListener(msg) {
for(int i=0;i<1000;i++)
{
console.log("received broadcast: " + msg + ", " + msg.data[i]);
$(<'')
$('').html(msg.data[i]).prependTo('#contentList').animate({color: "#000000"}, 6000);
$('')
$('html, body').animate({ scrollTop: 0 }, 0);
}
}
this is the code wat i have....the below mentioned solutions are not giving outcome for me... f i could not understand wat is controlid and for wat v r using it plz xplain
Thank u
Priyanka