$(function() {
  
    $('#button1').click(function() {
          setData();   
    });
    
    $('#button2').click(function() {
          getData();   
    });
    
    $('#button3').click(function() {
          getGlobal();
    });
    
    $('#button4').click(function() {
          getGlobalAndData();
    });
  });


  function setData() {
      $.data(document,"dataVariable","I'm not really hiding"); 
      globalVariable = "I'm not hiding";
  }

  function getGlobalAndData() {
      alert("The value of $.data is : " + $.data(document, "dataVariable") + "\n"
              + "The value of global is : " + globalVariable);
  }
    
  function getData() {
      alert("The value of $.data is : " + $.data(document, "dataVariable"));
  }
    
  function getGlobal() {
      alert("The value of global is : " + globalVariable);
  }
    
  function removeData() {
      $.removeData(document);
  }