title: Refreshing a DIV element which has JSP code snippet inside
body: <p>I have a JSP page where I am reading Session Attributes that I set in the Session.</p>
  
  <p>I want to read the Session attributes in regular intervals. I don't want to reload the whole page instead I am just keeping my JSP Session read attributes in my DIV and trying to reload the DIV. But it is not reloading the DIV.</p>
  
  <p>Here is my code base:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
    // Loading CSS and Script files
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="loadData" style='display:none;'&gt;
           &lt;% 
             String strStatus = String.valueOf(session.getAttribute("Status")) ;
            %&gt;
      &lt;/div&gt;
    &lt;/body&gt;
    &lt;script type="text/javascript"&gt;
      var reqStatus = '&lt;%= strStatus %&gt;';
  
      $(this).load(function(){
         setInterval(function() {
              $("#loadData").load();
            } ,1000);
       });
       $("#loadData").load(function(){
          if(reqStatus == 'Done') {
          // My Code goes here..
          }
       });
  &lt;/html&gt;
  </code></pre>
  
  <p>Any better ideas are also welcome.</p>