Last active
August 29, 2015 14:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $enclosure_search = $(xml).find("enclosure") | |
// different values for similar calls | |
$enclosure_search // -> Object { 0: <enclosure>, 1: <enclosure>, length: 2, prevObject: Object, context: undefined, selector: "enclosure" } | |
$enclosure_search[0] // -> <enclosure url="a"> | |
$($enclosure_search[0]) // -> Object { 0: <enclosure>, context: <enclosure>, length: 1 } | |
// Get the first enclosure tag explicitly - #attr() can no longer be called | |
$enclosure_search[0].attr('url') // -> TypeError: $enclosure_search[0].attr is not a function | |
// jQueryify the first_enclosure variable so that #attr() can be called on it | |
$($enclosure_search[0]).attr('url') // -> "a" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment