CMS Joomla Mastering Development

Access to returned Json single value from controller

i don’t understand how to access to a single value returned after ajax call datatype JSON.

My controller returned to me this value:

    name: Andrea
    catname: Minnie

How can i acces it from Ajax call response and do some check?
My Script is below

jQuery(document).ready(function($) {


  type: "POST",
  url: 'index.php?option=com_doclf_users&task=checkcodicefiscale&format=json',
  data: {
      'name_check' : 1,

dataType: "JSON",

  success: function(response){
  // I'd like something like
  if ( == 'Andrea')
  } else {
   //something else   

  error: function()
    $("#risultato").html('Errore durante l\'esecuzione della funzione');


Unroftunately it doesn’t work….

Can you explain to me how to get access on it?

Leave a Reply

Your email address will not be published. Required fields are marked *