title: joomla get content in onBeforeCompileHead function
body: <p>I'm developing a Joomla system plugin. I need to add javascript and css files if the certain <code>[myshortcode]</code> shortcode found in content.</p>
  
  <p>How can I get the content in onBeforeCompileHead function</p>
  
  <pre><code> function onBeforeCompileHead() {
          $document = JFactory::getDocument();
          //add scripts only if shortcode found
          ...
          $document-&gt;addStyleSheet($cssFile, 'text/css', null, array());
  </code></pre>
  
  <p>The <code>$content = JResponse::getBody();</code> does not work.</p>
  
  <p>Thanks</p>