How can I Pass a javascript variable value to PHP in Drupal 7 I am currently working on a project where i am required to pass Javascript variable value to php, i am able to do it vice-versa but unable to accomplish, this one.
Is there any way to get this done in Drupal 7 ?
If you want to pass the value during loading page. You can do it by appending the JS value as query variable in path (e.g. http://www.example.com/new/page?demo=true) for requesting the next page. In PHP, you can use API drupal_get_query_parameters to read the data.

// retrieve data from www.example.com?data=value
$query = drupal_get_query_parameters();
$value = $query['data'];