Joomla and Ajax Problem

Joomla and Ajax Problem

I am trying to use jquery, joomla and ajax together.  I can use jquery to return a simple string in joomla; but when i try to return something more complicated or use the joomla classes in side of the php file on the server side notthing happens. 
 
I think when you use ajax from withing joomla you loose scope of the variable. 
 
Has anyone had this problem before?  How do you solve it? 
 
Any help would be apprecited.