I am trying to create something similar to google which performs the folowing action.
The user searches with the student name and when he selects a specific student then a pop up menu opens with several of the student credentials.
I am able to fetch the data and with that data am calling a function in jquery which displays this data.
There are about 10 details that are being fetched from the database.
My jquery..
$.ajax({
url: "file.php",
type: "get",
data: {'init_data' : 'title_wise','title_name': value_text},
dataType: 'html',
success: function(data) {
length_turns=data.split('$').length;
while(num_turns<length_turns) {
temp_data_value[num_turns++]=data.substring(0,data.indexOf('$'));
if(num_turns==8)
temp_data_value[num_turns-1]=data;
temp_data_storage=data.substring(data.indexOf('$')+1);
data=temp_data_storage; }
and the function is..
function sample(data,data,data,data,data,data...........)
The data returned from the php is something like this..
echo fetched_data.'$'.fetched_data.'$'.fetched_data.'$'.fetched_data.'$'.fetched_data.'$'.fetched_data.'$'.fetched_data
The data is being fetched correctly and am able to view it..
The questions is, how should I pass these arguments to the function..should I pass them individually like
func(a[0],a[1].....)
or is there any other way of doing this like calling in a loop or doing something like this
how to pass multiple parameters to a method in java reflections
Also, say I return the function call directly from php like
func(a[0],a[1]...)
to jquery and now can I directly call this as a function here ?