Passing Settings from page.tpl to Javascript: Uncaught TypeError: Cannot read property I want to pass this to my js file :
in page.tpl  

&lt;?php
$my_settings = array(
    'message' =&gt; $message,
);

drupal_add_js(
    drupal_get_path('theme', 'sizin') .'/js/anim.js',
    array('my_settings' =&gt; $my_settings),

    'setting');
?&gt;  


in anim.js  

var message = Drupal.settings.my_settings.message;  


i got this error from chrome:  

Uncaught TypeError: Cannot read property 'message' of undefined   


Any Help/Idea ?

and i've read this : Retrive $message variables in javascript file
You need two line to add your code. Before one line to add js data settings:

$my_settings = array(
  'message' =&gt; $message,
);

drupal_add_js(array('my_settings' =&gt; $my_settings), 'setting');


and one line function to add file js

drupal_add_js(drupal_get_path('theme', 'sizin') .'/js/anim.js', 'file');


And better you don't write code in file tpl. You cand add js file, js  settings in hook_preprocess_page(). It's drupal standard and clean tpl file.