I am from stackideas.com the developers of both EasyBlog and EasyDiscuss. We actually have some integrations with Community Builder and we are actually trying to pull the avatars from Community Builder. However, we were having some issues whenever we try to call the following API,
The following block of javascript codes somehow get's outputted and causing the AJAX calls to fail,
Code:
<script type="text/javascript" src="/<a href="http://****.org/components/com_comprofiler/js/jquery-1.5.2/jquery-1.5.2.min.js?v=5dc11eced412cdd6" ><="" script><script"="">http://****.org/components/com_comprofiler/js/jquery-1.5.2/jquery-1.5.2.min.js?v=5dc11eced412cdd6"></script><script</a> type="text/javascript"><!--
jQuery.noConflict();
--></script>
<script type="text/javascript" src="/<a href="http://****.org/components/com_comprofiler/js/tabpane.min.js?v=5dc11eced412cdd6" ><="" script>"="">http://****.org/components/com_comprofiler/js/tabpane.min.js?v=5dc11eced412cdd6"></script></a>
<script type="text/javascript"><!--
jQuery(document).ready(function($){
var cbshowtabsArray = new Array();
function showCBTab( sName ) {
if ( typeof(sName) == 'string' ) {
sName = sName.toLowerCase();
}
for (var i=0;i<cbshowtabsArray.length;i++) {
for (var j=0;j<cbshowtabsArray[i][0].length;j++) {
if (cbshowtabsArray[i][0][j] == sName) {
eval(cbshowtabsArray[i][1]);
return;
}
}
}
}});
--></script>
The solution which I have used to fix this is to call the following method instead. Although this seems to work, it seems like in the source itself, this method will be deprecated in the future versions of Community Builder.
That's pretty much part of CB's browser-side API, although not used in standard cases for avatars, it is used by other field types.
That outputed javascript (properly into the page header) is using non-conflict mode, so unless the other javascript on the same page has bugs, it should not interfere imho ?
Yeah, the problem here actually is because we're trying to do an ajax calls to retrieve the contents (including avatars from Community Builder) and the document type is not 'html'. Perhaps there should be some checks on the document type before that block of script is being generated would help?
Was just wondering if you have any insights on this as we don't really want to use the $user->avatarFilePath since it will be deprecated in the future. Is there any other way to trigger or load the user's avatar without also triggering the browser's API?