Trouble passing PHP variables to JS using "attach"
Have a look on this page

For getting the value of a variable that has been set in the module you have to use like this Drupal.settings.&lt;modulename&gt;.&lt;variablename&gt;

In your module file 

function mymodule_page_build() {
  $status = variable_get('mymodule_status', 0);
  drupal_add_js(array('MODULENAME' =&gt; array('mymodule_status' =&gt; $status)), 'setting'); 

  $page['#attached']['js'] = array(
    array(
      'data' =&gt; drupal_get_path('module', 'mymodule') . '/mymodule.js',
      'options' =&gt; array(
        'preprocess' =&gt; TRUE,
        'every_page' =&gt; TRUE,
      ),
    ),
  );
}


So in your case it should be

Drupal.settings.mymodule.mymodule_status