Script error in JQuery
<p>i am getting script error in Jquery. please suggest how to resolve this. Script error message displayed is  <strong>"</strong><strong>HTML parsing error:</strong> unable to modify the parent container element before the child element closed<strong>".</strong>
<strong>code:0</strong>  <strong> line:0 </strong> <strong>char:0</strong>. My Jquery  code is:</p>

<pre><code>      &lt;script type="text/javascript"&gt;

     (function($) {
     var search=window.location.search.substring(1);
     var page=search.split("=");
     var location=window.location.toString();
     var url=location.split('?')[0];         

     if(page[1]=='custDetails'){

       $(document).ready(function(){
       $('#message').dialog('open');
       $(document).ready(function(){
       $('#pop').click(function(){
      $('#message').dialog('open');
       return false;
         });
       });
      });
     }   // end of if      
        else {
        $(document).ready(function(){
        $('#pop').click(function(){
        $('#message').dialog('open');
        return false;
          });
        });

        }  // end of else

        $('#message').dialog({
        width:200,
        autoOpen:false,
        buttons:{ 
           Close:function() {
       $ (this.dialog('close');
       $ ('#message').replaceWith('url');
                 }
              } 
          });

       $('#page').click((function(event){            
         window.print();
          });

        })  ($);
      &lt;/script&gt;
</code></pre>

<p>when i remove <strong>$('#message').dialog({}); </strong> component it doesn't throw script error. please suggest me the cause. </p>
