Here is what I'm trying to do:
In "app/design/frontend/default/default/template/catalogsearch/advanced/form.phtml" I have the following php statement
<?php $x=$this->getStoreCategories(); ?>
If I am not wrong $x would be an object and when i display it in php I am able to view it.
I need to convert this object into a javascript object (JSON) as i need to pass it using jQuery Ajax
But when I execute
<script>
var obj = JSON.parse('<?php echo json_encode($x) ?>');
alert(obj.toSource());
</script>
The alert gives me an empty object
Can anyone please help me out
Thanks in advance