Answer the question
In order to leave comments, you need to log in
How to display alert in div?
<script>
// Это json который пришел
var json = '<?php echo $s;?>';
// Здесь парсим json
var data = JSON.parse( json );
// Здесь получаем нужное свойство
alert( data.icestats.source.title );
</script>
Answer the question
In order to leave comments, you need to log in
Do you want the alert content to be added to a block on the page?
If the block has already been created, for example, then pure js:
<div id="div-name"></div>
<script>
var myDiv= document.getElementById('div-name'),
json = '<?php echo $s;?>',
data = JSON.parse( json );
myDiv.innerHTML = data.icestats.source.title;
</script>
$('#div-name').html(data.icestats.source.title);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question