[jQuery] comments in text()
Hello, here's a minor thing:
The definition of .text() seems to me to return the contents of
anything that doesn't have a nodetype of 1, but shouldn't it also
filter out comment and CDATA nodes? Consider this page:
✁
<html>
<head>
<script type="text/javascript" src="jquery.js"> </script>
<script type="text/javascript" >
$('document').ready(function(){
alert( $('body').text() );
});
</script>
</head>
<body>
<!-- i am a sneaky comment -->
<script type="text/javascript" >
<![CDATA[
i am swimming in a C of DATA
]]>
</script>
</body>
</html>
✃
Here's what pops up:
✁
i am a sneaky comment
<![CDATA[
i am swimming in a C of DATA
]]>
✃
Is this expected?
regards,
-p@
--
ᗷɭoℊẚᗰսɳᑯѲ⁈⁈⁈
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/