Hi again,
I'm trying to access to an element of the array and the attribute that
i marked to substitute is disappearing,
the stage:
json data: from a cakephp application rendering the data like:
response(<?= json_encode( $contents) ?>);
a function named response is rendered with the data in
json format like:
response([{"Activity":
{"id":"44","type_of_content":"Activities","type":null,"category_id":null,"relative_id":null,"far_relative_id":null,"order":"0","permalink":"isidoro" ...
the html code:
<div id="template">
<span></span>
</div>
<script type="text/javascript" charset="utf-8">
function response(data){
var directive = {
'span':{
'it<-response':{
'+.':'
it.Activity.id'
}
}
};
$('#template').render(data, directive);
}
$.getJSON("
http://myapp/mymethod?jsoncallback=?");
</script>
The result: span is erased from the code for that reason pure is
telling that span attribute is not in the div template.
My theories: I'm not accessing well to the element in the array, the
function response is disturbing pure.js or is not a well method to
display json data
Someone have the same problem?
Thank you very much