Saturday, August 25, 2012

Use Javascript Object in PHP without POST or AJAX

Is there a way to pass a JSON object directly into PHP and work with it?


Something like this:



<script>
var gridData = {\"id\":100,\"level\":\"B\",\"Zone\":\"Entry\"};
</script>
<?php
echo \"Your grid Information is:\". [**How to get the gridData displayed here**]
?>


I know I can pass to backend using AJAX, get the result and show it up in a div, but is there an easier way since I am already in this page and I already have the data in Javascript?


Also please note: I am working off some really old legacy code I inherited with lot of business logic calculations in a custom javascript platform, so please bear with me that the whole architecture is a bit odd :)






Rating: 4 out of 5 based on 3 ratings



The post Use Javascript Object in PHP without POST or AJAX appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/use-javascript-object-in-php-without-post-or-ajax.html

No comments:

Post a Comment