Remy Sharp, Developer, writer, thingymejiggy at Left Logic@mathias - absolutely right. I quickly added that slide last minute and I did have a gut feeling that .attr('href') was the source value of the markup, rather than the DOM. The real examples I see they don't care whether it's relative or absolute, and often it's used to get the hash out - which should just be this.hash. Thanks for the comment though - I'll update my future slides (/if/ I do this deck again... :) - cheers.1 year ago
Are you sure you want to
Mathias Bynens, Freelance front-end developer at QiwiSlide 48 and 49: `$(this).attr('href')` equals `this.getAttribute('href')`, not `this.href`. The latter usually gets normalized into the full resolved URL while the attribute value can be a relative reference.1 year ago
1–2 of 2 previous next