removing scripts from html data... using javascript
 So I have this function to strip out scripts from the page, but some scripts that are many lines long are still showing up.  Is there a way to remove all scripts from the page that loads.

     function filterData(data){
  
    // filter all the nasties out
    // no body tags
    data = data.replace(/<?\/body[^>]*>/g,'');
    // no linebreaks
    data = data.replace(/[\r|\n]+/g,'');
    // no comments
    data = data.replace(/<--[\S\s]*?-->/g,'');
    // no noscript blocks
    data = data.replace(/<noscript[^>]*>[\S\s]*?<\/noscript>/g,'');
    // no script blocks
    data = data.replace(/<script[^>]*>[\S\s]*?<\/script>/g,'');
    // no self closing scripts
    data = data.replace(/<script.*\/>/,'');
	
    // [... add as needed ...]
    return data;
      }
removing scripts from html data... using javascript
===

 So I have this function to strip out scripts from the page, but some scripts that are many lines long are still showing up.  Is there a way to remove all scripts from the page that loads.

     function filterData(data){
  
    // filter all the nasties out
    // no body tags
    data = data.replace(/<?\/body[^>]*>/g,'');
    // no linebreaks
    data = data.replace(/[\r|\n]+/g,'');
    // no comments
    data = data.replace(/<--[\S\s]*?-->/g,'');
    // no noscript blocks
    data = data.replace(/<noscript[^>]*>[\S\s]*?<\/noscript>/g,'');
    // no script blocks
    data = data.replace(/<script[^>]*>[\S\s]*?<\/script>/g,'');
    // no self closing scripts
    data = data.replace(/<script.*\/>/,'');
	
    // [... add as needed ...]
    return data;
      }