Hi All
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 (*id_menu_bar*) which contains a number. I want that this variable gets transported to the second JavaScript and is used there.
How do I make that?
Here the Script
menu_bar.js
$(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);}
   });
});