title: Fatal error: Call to undefined method JDocumentRaw::addCustomTag() in joomla 2.5
body: <p>I have a sample code:
  in default.php:</p>
  
  <pre><code>&lt;?php
  JHTML::_('behavior.mootools'); /* to load mootools */
  $ajax = "
  /* &lt;![CDATA[ */
  window.addEvent('domready', function() {
      $('start_ajax').addEvent('click', function(e) {
          e.stop(); 
          var url = 'index.php?option=com_xxx&amp;controller=xxx&amp;task=updateAjax&amp;format=raw';
          var x = new Request({
              url: url, 
              method: 'post', 
              onSuccess: function(responseText){
                  document.getElementById('ajax_container').innerHTML = responseText;
              }
          }).send(); 
      });
  })
  /* ]]&gt; */
  " ;
  $doc = &amp;JFactory::getDocument();
  $doc-&gt;addScriptDeclaration($ajax);
  ?&gt;
  </code></pre>
  
  <p>And controller of default.php i using code:</p>
  
  <pre><code>function updateAjax() {
     echo date('Y-m-d D H:i:s');
  }
  </code></pre>
  
  <p>When i run code is error <code>undefined method JDocumentRaw::addCustomTag()</code>, how to fix it ?</p>