Cannot pass variable to js file
Interchange below lines that should work !!

$max_length = 10; //variable_get('title_max_length');
drupal_add_js(drupal_get_path('theme', 'myTHEME'). '/js/script.js');
drupal_add_js(array('common' =&gt; array('max' =&gt; $max_length)), array('type' =&gt; 'setting'));


to

$max_length = 10; //variable_get('title_max_length');
drupal_add_js(array('common' =&gt; array('max' =&gt; $max_length)), array('type' =&gt; 'setting'));
drupal_add_js(drupal_get_path('theme', 'myTHEME'). '/js/script.js');