title: Liferay JavaScript Function is not defined
body: <p>I am new to liferay and I have been trying to do Ajax but my script does not load inside the browser. <em>I also tested it by inserting a simple alert.</em></p>
  
  <p>I've been getting the "<em>function is not defined</em>" error.</p>
  
  <p>Below is my liferay aui script:</p>
  
  <pre><code>Liferay.provide(window,'refreshFunction',
      function(param){
          alert('param: ' + param);
          A.one('#divToBeRefreshed').plug(A.LoadingMask);
          var mask = A.one('#divToBeRefreshed').loadingmask;
          mask.show();
          var dTime = new Date();
          var dynamicURL = '&lt;%=resourceURL %&gt;&amp;t=' + dTime.getTime().toString();
  
          A.io.request(dynamicURL, {
              method: 'GET',
              cache: false,
              data : {
                  param: param
              },
              on: {
                  success: function(event, id, obj) {
                      var response = this.get('responseData');
                      mask.hide();
                      $('#divToBeRefreshed').html(response);
                  },
                  fail: function(event, id, obj) {
                      mask.hide();
                  }
              }
          });
      },
      ['aui-base']    
  );  &lt;/aui:script&gt;
  </code></pre>
  
  <p>Is there something wrong in my script? what might be the problem? <strong>HELP!</strong></p>