Hi,
I'm trying to build a JSON app, so the data passed between the server and the client is just JSON.
I have a perl script that spits out some JSON to the template
I have in my template
But that errors with
And If I check myJSON I get blank? (I should get object object)
the JSON from the above template output is
So why is obj null?
Thanks,
Craig.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I'm trying to build a JSON app, so the data passed between the server and the client is just JSON.
I have a perl script that spits out some JSON to the template
Code:
$template->param( 'JSON' => encode_json(\@data) );
I have in my template
Code:
<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
var myJSON = $.parseJSON(<tmpl_var name='JSON'>);
$('#json_test').loadJSON(myJSON);
});
// ]]>
</script>
But that errors with
[13:10:40.569] TypeError: obj is null @ jquery.loadJSON.js:156
And If I check myJSON I get blank? (I should get object object)
the JSON from the above template output is
Code:
var myJSON = $.parseJSON([{"FirstName":"Test FName","LastName":"Test LName","CompanyName":"My Test Company","Prod_Type":"Decreasing Term Life","Prod_Provider":"Legal & General"}]);
So why is obj null?
Thanks,
Craig.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music