title: Filtering HTML for javascript output
body: <p>I'm using the prettyPhoto API to open the the lightbox manually with the following code:</p>
  
  <pre><code>api_images  ['images/fullscreen/image1.jpg','images/fullscreen/image2.jpg','images/fullscreen/image3.jpg'];
  api_titles = ['Title 1','Title 2','Title 3'];
  api_descriptions = ['Description 1','Description 2','Description 3']
  $.prettyPhoto.open(api_images,api_titles,api_descriptions);
  </code></pre>
  
  <p>The problem i'm facing is that the description values are pulling from Wordpress's WYSIWYG and the code is easily broken with random html tags, punctuation etc</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#menu-item-1006').on('click', function(e) {
              e.preventDefault();
              var images = new Array();
              var descriptions = new Array();
              var titles = new Array();
  &lt;?php
  $i = 0;
  $images = new WP_Query(array('post_type' =&gt; 'clearance', 'showposts' =&gt; -1, 'order' =&gt; 'menu_order', 'orderby' =&gt; 'ASC'));
  if ($images-&gt;have_posts()) : while ($images-&gt;have_posts()) : $images-&gt;the_post();
  
          $featured = wp_get_attachment_image_src(get_post_thumbnail_id($post-&gt;ID), 'full');
          ?&gt;
                              images[&lt;?php echo $i; ?&gt;] = '&lt;?php echo $featured[0]; ?&gt;';
                              titles[&lt;?php echo $i; ?&gt;] =  '&lt;?php the_title(); ?&gt;'
                              descriptions[&lt;?php echo $i; ?&gt;] = '&lt;?php echo get_the_content(); ?&gt;';
  
          &lt;?php
          $i++;
      endwhile;
  else:
      ?&gt;
  &lt;?php endif; ?&gt;
  
              $.prettyPhoto.open(images, titles, descriptions);
          }) 
      });    
  &lt;/script&gt;
  </code></pre>
  
  <p>How can i filter the get_the_content() function so it will output w/o errors? Thanks!</p>