PHP string array to javascript string array parsing error -


i've tried

var name = <?php echo json_encode($eventname); ?>;  

and

var name = new array("<?php echo implode('","', $eventname);?>");  

to parse name string array php javascript. displayed

var name = ["lalalala","lalala","test"];  

and

var name = new array("lalalala","lalala","test");  

in viewsource, when tried use name[i] string, returned character, not string. size of array name not 3, 20 (which total number of characters plus 3 ","). how can fix this?

pretty sure because 'name' points window.name (thanks fabrício matté). look here

it works fine if change 'name' 'names'.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -