Quote from: sottwell at Oct 21, 2013, 07:45 PMJust use the URL to the resource as the target of your AJAX call:
$.get( "myAJAXresource.html", ...
Personally, I much prefer using load() http://api.jquery.com/load/
Thanks Bruno and Susan, u guys were much help...I have finally gotten the thing.
For the template variables that were not getting resolved I used placeholders instead then passed an array containing the TV name/value as array elements.
//handle the template variables
$someresource = $modx->getObject('modResource',$someresourceId);
$resourceArray = $someresource ->toArray();
$tvArray = array();
$templateVars = &$someresource->getMany('TemplateVars');
foreach($templateVars as $templateVar)
$tvArray[$templateVar->get('name')] = $templateVar->get('value');
$pageArray = array_merge($resourceArray,$tvArray ); //gets all template tags for the page: TVs, Chunks, Snippets
return $modx->getChunk($tpl,$pageArray ); //the chunk must contain placeholders that values on the pageArray will replace
There may be a better solution but other than some possible performance issues this is perfect for my use case. after I deal with this deadline I intend to come back to thhis if I can get a better way.