title: Reload a javascript using jquery
body: <p>I have made a PHP file that shows up a session meter for Joomla's frontend using JavaScript. I have also made an other PHP file that shows the user's details and it reloads using jQuery. What I want to do is, when I press jQuery's reload button, JavaScript session meter reload too.</p>
  
  <p><strong>Session Meter PHP:</strong></p>
  
  <pre><code>&lt;?php // NO DIRECT ACCESS
           defined('_JEXEC') or die('Restricted access');
  
           $document = &amp; JFactory::getDocument();
           $document-&gt;addStyleSheet('***/***/session_meter.css');
           include('***/***/scripts.php');
           $document-&gt;addScriptDeclaration($javascript);
  
           $output = array();
           $session = &amp; JFactory::getSession();
           $expire = $session-&gt;getExpire();
           $output[] = '&lt;span id="log_res" class=""&gt;'.$expire.'&lt;/span&gt;';
  
           foreach ($output as $item){echo $item;}
           ?&gt;
  </code></pre>
  
  <p><strong>Session Meter javascript (part of it):</strong></p>
  
  <pre><code>&lt;?php // NO DIRECT ACCESS
           defined('_JEXEC') or die('Restricted access');
  
           $javascript  = ' var timer_start =$time(); '."\n";
           $javascript .= 'blah blah blah...
           ?&gt;
  </code></pre>
  
  <p><strong>User Profile JQuery script (part of it):</strong></p>
  
  <pre><code>&lt;?php // NO DIRECT ACCESS
      defined('_JEXEC') or die('Restricted access'); ?&gt;
  
          &lt;script&gt;        
      var $JQ_ = jQuery.noConflict();
  
      $JQ_(document).ready(function(){        
  
      $JQ_("#refresh_button").click(function(){$JQ_("#r_points").load('index.php #r_points').fadeOut(1000).fadeIn(1000);});       
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>I am trying to do something like this:</p>
  
  <pre><code>$JQ_("#refresh_button").click(function(){
      $JQ_("#log_res").load('index.php #log_res').fadeOut(1000).fadeIn(1000);
  });
  </code></pre>
  
  <p>but it only reloads session meter's <code>span</code> and <strong>not</strong> its JavaScript!</p>
  
  <p>Any idea?</p>