title: Passing a variable from php to javascript
body: <p>I am trying to pass a php variable to my LinkONCLick4 function, but for some reason, the variable is not being passed to conversation.php and the function does not even work.  I used this same function earlier on one of my web pages and it worked fine; I don't why it is not working now.  I anyone could help me that would be great!</p>
  
  <pre><code>&lt;script&gt;
      function LinkOnClick4(box) {
      $('#friendresults').load('conversation.php?id=' + box);
      }
      &lt;/script&gt;
      &lt;div id='showfriends' style='display:none;'&gt;
      &lt;div style="margin-top:5px;"&gt;&lt;input type='text' name='searchfriends' id='searchfriends' class='searchfriends' autocomplete="off" value="Search for a friend..." onClick="this.style.border = '1px solid #4F94CD'; document.getElementById('friendresults').style.visibility = 'visible';" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue; this.style.border = '1px solid #5E5E5E';" onkeyup='searchfriends()'/&gt;&lt;/div&gt;
      &lt;div id='hrdiv3'&gt;&lt;/div&gt;
      &lt;div id='friendresults' name='friendresults' style='float:left;'&gt;
      &lt;?php
      $construct = "SELECT * FROM acceptedfriends WHERE profilename='$profilename' ORDER BY id DESC LIMIT 6";
      $run = mysql_query($construct);
      $foundnum = mysql_num_rows($run);
      while ($runrows = mysql_fetch_assoc($run))
      {
      $users = $runrows['username'];
      $location = $runrows['imagelocation'];
      $image = "&lt;img src='$location' style='width:60px; height:40px;' /&gt;";
      if ($profilename==$username)
      {
      echo '&lt;div id="hovercolor2" onclick="LinkOnClick4('.$users.')" style="width:294px; float:left;"&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;'.$image.'&lt;/td&gt;&lt;td&gt;&lt;div style="margin-bottom:5px;"&gt;&lt;a href="http://www.pearlsquirrel.com/'.$users.'" target="_blank"&gt;'.$users.'&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.pearlsquirrel.com/conversation.php/'.$pageusers.'" style="text-decoration:underline;" target="_blank"&gt;&lt;div style="font-size:.7em";&gt;Click to enter a conversation.&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;div id="hrdiv3" style="float:left; width:298px;"&gt;&lt;/div&gt;';
      }
      else
      {
      echo '&lt;div id="hovercolor2" style="width:294px; float:left;"&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;'.$image.'&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.pearlsquirrel.com/'.$users.'" target="_blank"&gt;'.$users.'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;div id="hrdiv3" style="float:left; width:298px;"&gt;&lt;/div&gt;';
      }
      }
      ?&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>