Pretty photo not working in php
<p>I am trying to add the jquery pretty photo plugin in my php, but it's not working. What am I doing wrong? I am using ajax to request this php file (display.php). I am also including the pretty photo plugin on the calling php file.</p>

<p>here is the code for display.php:<br>
         

<pre><code>        $query1 = "select imgid from imageinfo";
          $result1 = queryMysql($query1);
          $num1 = mysql_num_rows($result1);

       for($j=0; $j&lt;$num1; ++$j)
         {
               $row1 = mysql_fetch_object($result1);
               $imgid = $row1-&gt;imgid;
          echo" &lt;li style=\"float:left;list-style-type:none;margin-left:20px;margin-   bottom:15px;\"&gt;&lt;a href=\"viewuploads/$imgid\" rel=\"prettyPhoto[gallery2]\"&gt;&lt;img src=\"binuploads/$imgid\" alt=\"\" border =\"0\" /&gt;&lt;/a&gt;&lt;/li&gt;";


          }
echo "&lt;script src=\"jquery.js\" type=\"text/javascript\"&gt;&lt;/script&gt;
 &lt;link rel=\"stylesheet\" href=\"css/prettyPhoto.css\" type=\"text/css\"  media=\"screen\" title=\"prettyPhoto main stylesheet\" charset=\"utf-8\" /&gt;
 &lt;script src=\"js/jquery.prettyPhoto.js\" type=\"text/javascript\" charset=\"utf-8\"&gt;   &lt;/script&gt;";

  echo '&lt;script language="JavaScript" type="text/javascript"&gt;'."\n";
  echo "$(\"area[rel^='prettyPhoto']\").prettyPhoto();

            $(\".gallery:first    a[rel^='prettyPhoto']\").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
            $(\".gallery:gt(0) a[rel^='prettyPhoto']\").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: t   rue});

            $(\"#custom_content    a[rel^='prettyPhoto']:first\").prettyPhoto({
                custom_markup: '&lt;div id=\"map_canvas\"   style=\"width:260px; height:265px\"&gt;&lt;/div&gt;',
                changepicturecallback: function(){ initialize(); }
            });

            $(\"#custom_content a[rel^='prettyPhoto']:last\").prettyPhoto({
                custom_markup: '&lt;div id=\"bsap_1259344\"  class=\"bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6\"&gt;&lt;/div&gt;&lt;div id=\"bsap_1237859\"  class=\"bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6\" style=\"height:260px\"&gt;&lt;/div&gt;&lt;div  id=\"bsap_1251710\" class=\"bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6\"&gt;&lt;/div&gt;',
                changepicturecallback: function(){ _bsap.exec(); }
            });";
   echo "\n".'&lt;/script&gt;';
   ?&gt;
</code></pre>
