how to pass an variable thats an array to a function
I am having trouble passing an array to a java script function. here is my code.
Its weird I created another variable called test and set it equal to the array($test = "$row"; )
it worked, but does not show the word. What it does is just shows one of the letters if I do test in ....american('$test')... why wont it show the whole word when its just $test, and why nothing shows with $row
$test doesn't have any value in the code you have posted here. Assuming $row is a string within an array of $row, then using $test would be the first letter of the value in $row.
As for the JS, the only thing I can see being a problem PHP wise is if your string contains a ' within it which would damage the request for the american function call. Otherwise, assuming that $row is a valid array, everything looks fine. You can check your output HTML source to see what's in the <button> value and onclick attribute.
|All times are GMT +1. The time now is 07:12 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.