title: html code inside javascript function divxwebplayer
body: <p>I have one website that contains database of movies (like IMDB). I would like when user click on movie cover (image) a window of divxwebplayer to open and play avi file from server. I have try but no success.</p>
  
  <p>inside img tag a i have added onclick function that calls showmyvideo(). then i write function showmyvideo() { } but i don't know how to write html code inside javascript function to be executed. here is my html code that needs to be executed inside showmyvideo() function:</p>
  
  <pre><code> &lt;object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="320" height="260" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab"&gt;
  &lt;param name="custommode" value="none" /&gt;
  &lt;param name="autoPlay" value="false" /&gt;
  &lt;param name="src" value="film.avi" /&gt;
  
  &lt;embed type="video/divx" src="&lt;?php echo $moviename ?&gt;.avi" custommode="none" width="320" height="260" autoPlay="false"  pluginspage="http://go.divx.com/plugin/download/"&gt;&lt;/embed&gt;
  </code></pre>
  
  <p></p>
  
  <p>Many Thanks.</p>
  
  <p>i wouldlike when user click on image that divxweb player is openede on the screen and play avi file.</p>
  
  <p>this is code that i im trying and traying but no go.please if some one can help me.</p>
  
  <pre><code>&lt;!-- DivX Web Player --&gt;
  &lt;a onClick="DivXWebPlayer('&lt;?php echo $title; ?&gt;', '&lt;?php echo $year; ?&gt;')" class="item-image"&gt;
  
  function DivXWebPlayer(title, year)
  {
      $.ajax({
          url: 'http://&lt;?php echo $source; ?&gt;/player.php?title='+title+'&amp;year='+year,
          success: function(data) {
          $('#popup2').html('&lt;div&gt;' + data + '&lt;/div&gt;');
          },
          error: function(request, error, errormessage) {
          $("#messages").html(error + '\n' + errormessage);
        }
      });
      e.preventdefault();
      return false;
  };
  </code></pre>
  
  <p>and a file player.php</p>
  
  <pre><code>&lt;?php
  /* get movie location */
  $tit = $_GET['title'];
  $yer = $_GET['year'];
  $gen = $_GET['genre'];
  </code></pre>
  
  <p>?></p>
  
  <pre><code>&lt;div&gt;
  &lt;object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="320" height="260" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab"&gt;
      &lt;param name="src" value="movie.divx"/&gt;
  
      &lt;embed
          type="video/divx"
          src="./Drama/&lt;?php echo $tit; ?&gt; [&lt;?php echo $yer; ?&gt;].avi"
          width="320" height="260"
          pluginspage="http://go.divx.com/plugin/download/"&gt;
      &lt;/embed&gt;
  &lt;/object&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>any help welcome..where i was doing wrong?</p>