title: call a php variable on hover using ajax
body: <p>I have a variable <code>$form</code> in PHP and want it to be called or displayed whenever I hover a button.
  I am a novice in ajax and don't know how to call the variable on hovering the button.
  The code is:</p>
  
  <p>Javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $("#login_button").hover(function() {
              $("login-form").slideDown(400);
          });
          $("#login_button").hover(function() {
              $("login-form").css('visibility','visible'); 
          });
          $("#login_button").dblclick(function() {
              $("login-form").slideUp(1200);
          });
          $("#login-form").mouseleave(function() {
              $("login-form").slideUp(1000);
          });
      });
  &lt;/script&gt; 
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
  $form = "&lt;form action='?' method='post' id='login-form' name='login-form'&gt;&lt;!-- class='form-horizontal well' --&gt;
           &lt;strong&gt;&lt;legend&gt;Login&lt;/legend&gt;&lt;/strong&gt;
           &lt;fieldset id='inputs'&gt; 
               &lt;input type='text' placeholder='Username' name='name' class='input-large' id='username'&gt;
               &lt;input type='password' placeholder='Password' name='password' class='input-large' id='password'&gt;
           &lt;/fieldset&gt;    
           &lt;fieldset id='actions'&gt;    
               &lt;input type='submit' id='submit' class='btn btn-primary' value='Sign in'&gt;
               &lt;div class='forgot'&gt;  
                   &lt;strong&gt;&lt;a href='?forget=1' id='forget'&gt;Forgot Password?&lt;/a&gt;&lt;/strong&gt;
               &lt;/div&gt;
           &lt;/fieldset&gt;
           ";
  ?&gt;
  </code></pre>