I am trying to send a value in JavaScript variable to Drupal. I am calling an external js file in hook_nodeapi()
. I want to send a value from this external js file to Drupal, and want to use this value in Drupal in hook_block
.
For example
hook_nodeapi() {
// call(external.js)
}
external.js
var sendData =10;
hook_block
{
case view:
// need to access sendData value
}
I tried this using cookies, but I think that is not the best way. How can this be done?