Это пример использования MutationObserver из Mozilla , адаптированного из этого сообщения в блоге
Chrome 18+, Firefox 14 +, IE 11+, Safari 6 +
// Select the node that will be observed for mutations
var targetNode = document.getElementById('some-id');
// Options for the observer (which mutations to observe)
var config = { attributes: true, childList: true };
// Callback function to execute when mutations are observed
var callback = function(mutationsList) {
for(var mutation of mutationsList) {
if (mutation.type == 'childList') {
console.log('A child node has been added or removed.');
}
else if (mutation.type == 'attributes') {
console.log('The ' + mutation.attributeName + ' attribute was modified.');
}
}
};
// Create an observer instance linked to the callback function
var observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer.observe(targetNode, config);
// Later, you can stop observing
observer.disconnect();
Я не знаю, работает ли это, потому что я не могу проверить его, но я предлагаю что-то вроде этого:
$expression = 'STUFF((SELECT ',' + answer as lookingfordetails FROM table FOR XML PATH('')),1 ,1 ,'')';
$query->addExpression($expression);
Я думаю, вы могли видеть преобразование group_concat в другие базы данных: http://www.sqlines.com/mysql/functions/group_concat