Update divs without reload page - jquery / ajax setInterval
<p>A website with a notification system and private messages system use setInterval to update the relevant 2 divs without page reload.</p>

<p>Therefore I use:</p>

<pre><code>&lt;script&gt;
$(document).ready(function () {
setInterval(function() {
    $.get("notifi_reload.php?n=1", function (result) {
        $('.notifications').html(result);
    });
}, 10000);

setInterval(function() {
    $.get("notifi_reload.php?n=2", function (result) {
        $('.private_messages').html(result);
    });
}, 10000);
});
&lt;/script&gt; 
</code></pre>

<p><strong>The notifi_reload.php gives out only a number. Code:</strong></p>

<pre><code>$notifi = $_GET["n"];

// 1 = notification
if ($notifi == 1)
{

echo $user-&gt;data['user_notification_count'];

} else{

// 2 = PM
echo $user-&gt;data['user_new_privmsg'];

}
</code></pre>

<p><strong>Problem:</strong></p>

<p>I have every 10000 seconds <strong>2</strong> $.get requests. Is it anyways possible to have only <strong>1</strong> $.get requests? Maybe I can structure the notifi_reload.php to have both present?</p>

<p>Thank you</p>