Bug Tracker

Opened 10 years ago

Closed 9 years ago

#6344 closed bug (invalid)

selector bug with div and script

Reported by: ShoAn Owned by:
Priority: undecided Milestone:
Component: selector Version: 1.4.2
Keywords: selector script tag Cc:
Blocked by: Blocking:

Description

Hello,

I tried to migrate from 1.3.2 to 1.4.2.

If I want to select a div, which contains a script tag, I found a different behavior between these versions: jQuery 1.4.2 returns the script tag, too ... ?? tested on ff 3.6.2 and ie 8

<body>
<div id="test">
    <script></script>
    <p></p>
</div>

<script type="text/javascript">
    console.info($('#test'));
    console.info($('\
        <div>\
            <script><\/script>\
            <p><\/p>\
        <\/div>\
    '));
</script>
</body>

output with jQuery 1.3.2

[div#test]
[div]

output with jQuery 1.4.2

[div#test]
[div, script]

Greets, Dominik Winter

Change History (2)

comment:1 Changed 9 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:2 Changed 9 years ago by snover

Priority: undecided
Resolution: invalid
Status: newclosed

Thanks for the report, but this is not a jQuery bug. The script tag is only removed once an element is added to the DOM.

Note: See TracTickets for help on using tickets.