kindly let me know how to display list tabres on vf page . actually in alert box its displaying all the 5 values. but when i am calling it in div tag having id mytable1 its displaying undefined. i think i am very close. kindly help. apex class code:-
public class javascriptremoting {
@remoteAction
public static List<Account> loadaccs(){
return [select Id,Name,Phone from Account where Phone !=null];
}
vf page code:-
<apex:page controller="javascriptremoting" >
<script>
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.javascriptremoting.loadaccs}',
function(result, event){
var tabres= [];
alert(result);
for(i=0;i<5;i++){
tabres.push(result[i].Name);
}
alert(tabres);
for(i in tabres){
firstnames = firstnames + tabres[i].Name;
}
document.getElementById('mytable1').innerHTML = firstnames;
},
{escape: true}
);
</script>
<div id="mytable1" >
</div>