-2

Hi im making an jQuery ajax call from an view in my Joomla component. and need the raw output.

I have tried to search the Joomla documentation but cannot find any tutorials or documentation how to use and implement the raw output. Do someone have an link or can tell me how for joomla 2.5.

Sincerely Morten

  • You should clarify your question with code .It will help others to understand your requirement.. – Jobin Dec 14 '12 at 17:05
  • 1
    Read this - it should answer your question http://stackoverflow.com/questions/10739611/joomla-component-output-without-html – George Wilson Dec 15 '12 at 01:53

1 Answers1

0

This is how I request data via ajax for html form with id 'formdata'. I serialize the data from the form, and submit it via ajax to a raw view, and then i display the content of the raw view as plain text in a div with id 'myformoutput'

<script type="text/javascript">
function formupdate()
{
    $.ajax({
        type: "POST",
        url: "index.php?option=com_mycomponent&view=outputview&format=raw",
        data: $('#formdata').serialize(),
        cache: false,
        success: function(html) {
        $('#myformoutput').html(html);
        }

      });   
}
</script>

The raw view is from the component com_mycomponent, and the view name is 'outputview'.

'outputview' has the file view.raw.php instead of view.html.php. it contains:

class mycomponentViewoutputview extends JView {

function display($tpl = null) 
    {
         echo 'this is raw text';
    }

}

Kasper DK
  • 557
  • 2
  • 7
  • 17