You need to sign in to do that
Don't have an account?
Mohan sharma
How to create dynamically array in javascript.
I want to make dynamic array in javascript from controller and then use it visualforce page i also want to push and pop some value from array.
Let say if you want to create an arry of Id and you have those id’s in a list i.e lstOfAccIds you can use below code to create an JavaScript array.
<script>
Var listOfIds = new Array();
<apex:repeat value=”{! lstOfAccIds} var=”key” >
listOfIds.push(key) ;
</apex:repeat>
Please mark it as best solution to your problem if it does solve your problem.
All Answers
Let say if you want to create an arry of Id and you have those id’s in a list i.e lstOfAccIds you can use below code to create an JavaScript array.
<script>
Var listOfIds = new Array();
<apex:repeat value=”{! lstOfAccIds} var=”key” >
listOfIds.push(key) ;
</apex:repeat>
Please mark it as best solution to your problem if it does solve your problem.
Can you please give more details as to what exactly you want to do.