Problem showing file info with Ajax and PHP
<p><br>
I have a list of files made by my PHP code
<code></p>

<pre><code>if ($handle = opendir($director))   
{
    $path="images/files/nou/";
    if(Files::is_empty_dir($director))
        {
            echo "&lt;p&gt;There are no script available.&lt;/p&gt;";
        }
    else
        {
   while (false !== ($file = readdir($handle))) 
   {
         if ($file != "." &amp;&amp; $file != "..")
            {
        $size=Files::getSize($director."/".$file);
        $exts=Files::getExtension($file);
                $filex = str_replace(".".$exts,"",$file);
            if(strlen($filex)&gt;10)
                {
                    $filex=substr($filex,0,6);
                }
                echo "&lt;div class='file' title='".$file."'&gt;".$filex."&lt;/div&gt;";
</code></pre>

<p></code></p>

<p>There are functions defined in my own class Files.
Good. I want that on mouseover to show file information with this code
<code></p>

<pre><code>function getInfo($file)
        {
            $info="&lt;div class='info_public'&gt;&lt;table border=0 cellpadding=2&gt;&lt;tr&gt;";
            $info.="&lt;td&gt;File : &lt;/td&gt;&lt;td&gt;".$file."&lt;/td&gt;&lt;/tr&gt;";
            $info.="&lt;tr&gt;&lt;td&gt;Extension : &lt;/td&gt;&lt;td&gt;".Files::getExtension($file)."&lt;/td&gt;&lt;/tr&gt;";
            $info.="&lt;tr&gt;&lt;td&gt;Size : &lt;/td&gt;&lt;td&gt;".Files::getSize($file)."&lt;/td&gt;&lt;/tr&gt;";

            return $info;
        }
</code></pre>

<p></code></p>

<p>I want to show info dynamically with JQuery. I wrote this
<code></p>

<pre><code>$(".file").mouseover(function()
    {
        data=$(this).attr("title");
        alert(data);
    });
</code></pre>

<p></code>
It alerts always first filename not what I crossed with mouse. But if I disable mouseover JQuery function, the title appears correctly for each file in part. If I use mouseover function, the selected value from title doesn't appear correctly, it shows first filename in alert no matter what file I crossed with mouse.</p>

<p>I called the alert function to see results before implementing $.ajax function to avoid bad responses.
What's the problem in my script ?</p>

<p>Thank you</p>
