jquery exclude some child nodes from .text()
You can achieve that by cloning your node, removing the script tags and retrieving the text()
value:
var content = $('#parent').clone();
content.find('script').remove();
console.log(content.text());
DEMO
You should clone the node in order to asure an unchanged DOM tree afterwards.
Try this:
($('#parent').text()).replace($('#parent script').text(),'');
Check out this Fiddle.