php Page and star rating plugin full rendered only after refresh
<p>I'm using <a href="http://www.fyneworks.com/jquery/star-rating/" rel="nofollow">fyneworks jquery star-rating</a> with jQuery mobile and in one page created dynamically with a PHP function everything is working fine.  But in another page where the "rating tab" is included in the PHP page, the stars are not rendered until I refresh the page.</p>

<p><strong>PAGE</strong></p>

<pre><code> &lt;?php
session_start();
if (!session_is_registered('autorizzato')) {
  echo "&lt;h1&gt;Area riservata, accesso negato.&lt;/h1&gt;";
  echo "Per effettuare il login clicca &lt;a href='login.php'&gt;&lt;font color='blue'&gt;qui&lt;/font&gt;&lt;/a&gt;";
  die;
}
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Title&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"&gt;
    &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;
    &lt;script src="jquery-1.8.2.min.js"&gt;&lt;/script&gt;
    &lt;script src="jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="jquery.mobile-1.2.0.min.css" /&gt;

    &lt;script src='rating/jquery.MetaData.js' type="text/javascript" language="javascript"&gt;&lt;/script&gt;
    &lt;script src='rating/jquery.rating.js' type="text/javascript" language="javascript"&gt;&lt;/script&gt;
    &lt;link href='rating/jquery.rating.css' type="text/css" rel="stylesheet"/&gt;

    &lt;script src="logged.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body background="#000000"&gt;

&lt;div data-role="page"  id="lista"&gt;
    &lt;div data-role="header" data-position="fixed"&gt;
    &lt;input type="submit" onClick="back()" data-icon="back" class="ui-btn-left" value="Indietro" /&gt;
        &lt;h1&gt;TITLE&lt;/h1&gt;
    &lt;a href="logout.php" data-icon="gear" class="ui-btn-right"&gt;Logout&lt;/a&gt;
    &lt;/div&gt;
    &lt;div data-role="content" data-theme="a"&gt;
    &lt;form id="save" action="saveComment.php" method="post" data-ajax="false"&gt;
    &lt;div data-role="fieldcontain"&gt;
        &lt;label for="textarea"&gt;Comment:&lt;/label&gt;
        &lt;textarea cols="40" rows="8" name="textarea" id="textarea"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
        &lt;label&gt;Rating:&lt;/label&gt;
        &lt;div data-role="content" &gt;
                &lt;input data-role="none" name="stars" type="radio" class="star" value="1"/&gt;
                &lt;input data-role="none" name="stars" type="radio" class="star" value="2"/&gt;
                &lt;input data-role="none" name="stars" type="radio" class="star" value="3"/&gt;
                &lt;input data-role="none" name="stars" type="radio" class="star" value="4"/&gt;
                &lt;input data-role="none" name="stars" type="radio" class="star" value="5"/&gt;
        &lt;/div&gt; 

        &lt;input type="hidden" name="id" value="&lt;?php echo $_GET["id"]; ?&gt;" /&gt;
         &lt;input type="hidden" name="rating" id="rating" value="1" /&gt;
        &lt;fieldset id="actions"&gt;
            &lt;input type="submit" id="submit" value="Invia"&gt;
        &lt;/fieldset&gt;
    &lt;/form&gt;

    &lt;/div&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>logged.js</strong></p>

<pre><code>$(document).load(function () {  
     $('#rt').click(function () {
            var div = $(this);
            div.children('input').each(function () {
                if ($(this).is(':checked')){
                    $('#rating').attr("value", $(this).val());
                } 
            });
        });

    });
</code></pre>

<p>I noticed that the page created dynamically by PHP is accessing my database, and takes about 2-3 seconds to display, and everything is rendered.  This second page is rendered only after I press F5 and refresh the page.</p>

<p>What am I missing?</p>
