Welcome Guest, Not a member yet? Register   Sign In
Help regarding passing data result array to javascript
#1

[eluser]Unknown[/eluser]
Hello i am making a project and facing a problem to pass data result array to javascript and manipulate dom according to data result array .
When i pass encoded JSON parsed array to javascript function , it is showing object,object object.
Kindly tell me code for decoding the JSON encoded array and iterating through that array . Any help will be appriciated .
#2

[eluser]regal2157[/eluser]
json_decode($string)? You said you needed to decode it..

sorry if I am misunderstanding your question.
#3

[eluser]toopay[/eluser]
Why you need to convert json -> array, in JavaScript? I thought it will be easier to process that way.
#4

[eluser]Unknown[/eluser]
Actually I have a data array passed to view as
$data['classes']=list of books of that class from database

now i want in view that select class form drop down then on change event it will populate the books of that class in another drop down

classess aray is something like this

classes{

classid=1,books=array of books of that class id ...

}
something like this .

i encoding the classes array in json and passing it to javascript function ..
Now how to iterate through that array and populate another drop down on value of first..

Kindly help




Theme © iAndrew 2016 - Forum software by © MyBB