JavaScript
- 4 ответа
- 0 вопросов
5
Вклад в тег
var array = [];
$('.inner-menu > span').each(function(){
array.push({
object: $(this),
name: $(this).text(),
sub: $(this).data('sub'),
pnd: $(this).data('pnd'),
otd: $(this).data('otd'),
});
});
console.log(array);
[{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3}]
$filter = array();
if($_GET['date']) {
$filter[] = ['date' => $_GET['date']]; //Или так $filter['date'] = $_GET['date'];
}
if($filter) {
$where = $modx->toJSON($filter);
}
$params = array(
'docid' => 198,
'tvname' => 'field-news',
'where' => $where
);
return $modx->runSnippet('getImageList', $params);