Modal Window load dynamic content and change it in times
<p>Hy guys.</p>

<p>I have a modal window that loads a page and I need to, after 90 seconds load another page.</p>

<p>I have...</p>

<pre><code>    &lt;table id="table4"&gt;
    &lt;tr&gt;
        &lt;td&gt;Id:&lt;/td&gt;
        &lt;td&gt;Nome:&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;1515&lt;/td&gt;
        &lt;td&gt;Thiago&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;2015&lt;/td&gt;
        &lt;td&gt;Guttierre&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>According to the ID, i will load a page that the id represents.. like <a href="http://www.test.com/1515" rel="nofollow">http://www.test.com/1515</a>. and after 90 seconds I have to load the other id... <a href="http://www.test.com/2015" rel="nofollow">http://www.test.com/2015</a>.</p>

<p>Now I have this script...</p>

<pre><code>$(document).ready(function() {

//seleciona os elementos a com atributo name="modal"
var aux = 2;
while (($("#table4 tr:nth-child(" + aux + ") td:nth-child(1)") != "")) {

    var idSOS = $("#table4 tr:nth-child(" + aux + ") td:nth-child(1)").text();
    if ((idSOS != "") &amp;&amp; (idSOS != undefined) &amp;&amp; (idSOS != null) &amp;&amp; (idSOS != "Id:")) {


        $("#dialog, #mask,#closediv").css({ 'display': 'block' });
        var maskHeight = "99%";
        var maskWidth = "99%";
        $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

        //Effect
        $('#mask').fadeIn(800);
        $("#dialog").fadeIn(1600);
        $('#mask').fadeTo("slow", 1);
        $('#dialog').fadeTo("slow", 1);

        //
        var winH = $(window).height();
        var winW = $(window).width();
        //centraliza na tela a janela popup
        $("#dialog, #mask").css('top', '2px');
        $("#dialog, #mask").css('left', '2px');

        //

        setTimeout(function() {
            var i = idSOS;
            loadContent(i);
        }, 10000);





        aux++;
        //            continue;
    } //end IF
    else {
        $("#dialog").empty();
        $("#dialog, #mask").hide();
        break;
    };


}; //END WHILE


$("#dialog, #mask").hide();

//se o botão fechar/tela for clicado
$('#closediv').click(function GetOut(e) {
    e.preventDefault();
    $('#mask,#closediv, .window').hide();
});

function loadContent(idSOS) {
    $("#dialog").load('/teste' + idSOS + '.aspx');
};
</code></pre>

<p>It only shows the second id loaded in the div. What I have to do to load the first ID loaded in the DIV "dialog" and then, after 90 seconds, show the second ID?</p>

<p>Where did I go wrong?</p>

<p>Thks folks.</p>
