Skip to main content

Bug Tracker

Side navigation

#14460 closed bug (notabug)

Opened October 17, 2013 08:01PM UTC

Closed October 17, 2013 09:59PM UTC

.remove() inconsistent between Safari and Chrome

Reported by: dereekb@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.3
Keywords: Cc:
Blocked by: Blocking:
Description

Chrome Version: 30.0.1599.101

Safari Version: 6.0.5 (8536.30.1)

The following code will run successfully in Chrome, but not in Safari.


   var results = $( "p" ),
       result = null,
    
       i;
    
    for(i = 0; i < results.length; i += 1)
    {
        result = results[i];
        result.remove();
    }

JSFiddle Test: http://jsfiddle.net/YqCzK/

In Safari, the segment will fail at result.remove() since the object does not have the remove function available (Actual error is 'undefined' is not a function.).

Calling remove() on the results array works in both browsers however.

Attachments (0)
Change History (2)

Changed October 17, 2013 08:38PM UTC by anonymous comment:1

result = results[i]

is not a jQuery-object anymore, thus don't have a $().remove()-function.

Either use

result = $(results[i])

or

result = results.eq(i)

Changed October 17, 2013 09:59PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

Agree, anonymous.