<?
class Openlibrary extend Controller{
생성자 어쩌고.. 생략;;
function load(){
echo '{key:"322",message:"hello.."}';
}
}
?>
$(document).ready(function(){
$.ajax({
url:"어쩌고/openlibrary/load",
success:function(data){
alert(data); // 하지만 result가 string;;;;
}
});
json_encode()로 해결했습니다. 감사합니다 ^^
근데.. 크롬에서는 코멘트창이 왜 안뜰까요;;
var datas = jQuery.parseJSON( jsong type string... );
$.each(datas, function(key, value) {
}
요렇게도 가능
php에서는 json_encode() 가 있습니다. 참고하셔요.