title: Is it possible to export a value of an variable from one javascript to an other?
body: <p>I have made a Web page using jquery and php where all files are used in a modular style. Now I have two JavaScript files which must communicate with each other. One Script generates a variable (<em>id_menu_bar</em>) which contains a number. I want that this variable gets transported to the second JavaScript and is used there.</p>
  
  <p>How do I make that?</p>
  
  <p>Here the Script</p>
  
  <p><strong>menu_bar.js</strong></p>
  
  <pre><code>$(document).ready(function() {
  
  function wrapper_action(id_menu_bar) {
    $(".wrapper").animate({height: "0px"});
    $("#changer p").click(function() {
      $(".wrapper").animate({height: "300px"});
    });
  }
  
    $("#select_place li").live("click", function() {
    var wrapper_id = $(".wrapper").attr("id");
    var id_place = this.id;
  
    if (wrapper_id != "place")
      {
      $("#select_level li").remove();
        $("#select_building").load("menu_bar/menu_bar_building.php?placeitem="+id_place, function() {
          $("#select_building li").click(function() {
          var id_building = this.id;
  
            if (wrapper_id != "building")
              {
              $("#select_level").load("menu_bar/menu_bar_level.php?buildingitem="+id_building, function() {
                $("#select_level li").click(function() {
                  var id_level = this.id;
                  wrapper_action(id_level);
                });
              });
  
              }
            else if (wrapper_id == "building")
              {wrapper_action(id_building);}
          });
        });
  
        }
     else if (wrapper_id == "place")
      {wrapper_action(id_place);}
     });
  
  }); 
  </code></pre>