Attention !
var test = '<?php echo json_encode($this->register['contry']); ?>';
ne va pas te donner comme résultat
var test ={"3":{"idcountry":"3","code":"AF","name":"Afghanistan"},"16":{"idcountry":"16","code":"AX","name":"Åland Islands"},"6":{"idcountry":"6","code":"AL","name":"Albania"},"64":{"idcountry":"64","code":"DZ","name":"Algeria"}
mais plutôt
var test ='{"3":{"idcountry":"3","code":"AF","name":"Afghanistan"},"16":{"idcountry":"16","code":"AX","name":"Åland Islands"},"6":{"idcountry":"6","code":"AL","name":"Albania"},"64":{"idcountry":"64","code":"DZ","name":"Algeria"}'
qui ne correspond pas à un objet JSON.
Partager