Andy E

United Kingdom

whattheheadsaid.com

Age: 31

I'm mainly a JavaScript coder, with some experience in other languages.

If I helped you a lot, dontations are welcome via GitTip, but just a thanks, an up vote or the green check is enough :-)

Sep
14
revised jQuery selector :contains - Use regular expressions
added 6 characters in body
Sep
10
awarded Good Answer
Sep
8
awarded Enlightened
Sep
8
awarded Nice Answer
Sep
8
revised javascript: split string straight to variables
added 286 characters in body
Sep
5
comment HTML5 foo.currentTime=1 not working when loaded from server chrome
+1 – I'm surprised that this doesn't seem to exist in any of the documentation I've looked through over the last few days. Our CDN isn't responding with this header and I was wondering why I couldn't seek audio files served from there. PS, don't forget to accept your answer.
Sep
4
revised Loading an image to a <img> from <input file>
added 328 characters in body
Sep
4
awarded Revival
Sep
2
awarded Supporter
Sep
2
awarded Famous Question
Aug
31
awarded Enlightened
Aug
31
awarded Nice Answer
Aug
27
awarded Supporter
Aug
15
comment how to validate credit card number
@Steve: it sure is, that's why I did note it at the bottom of my answer ;-)
Aug
14
comment Is there a way to detect if a browser window is not currently active?
@Heliodor: I'd like to keep the code in the answer minimal for now. It was never intended to be a cut-and-paste complete solution, as implementors might want to avoid setting a class on the body and take a completely different action altogether (such as stopping and starting a timer).
Aug
14
comment How should user agents handle unrecognized HTML elements?
@vol7ron: Another interesting point is that Anne van Kesteren's main reason for dismissing them as a bad idea was the potential naming collisions. The specs outlining the addition of custom elements force you to use at least one hyphen in the name, which ensures no possible future naming collisions (presumably because all future standardised elements will never have a hyphen). So, it's not so much a bad idea anymore, although consideration will need to be given. I believe there's a shim for the Web Components API, too, which might simplify creating your own elements.
Aug
13
comment How should user agents handle unrecognized HTML elements?
@vol7ron: custom elements now have their own specification, albeit in Working Draft status. The idea is that custom tag names with a hyphen are valid custom elements. If they don't have the hyphen, they retain HTMLUnknownElement as the prototype. Browser support is very limited at the moment, though. I haven't heard anything about custom elements sending browsers into quirksmode, so if you want to use them, then go ahead :-).
Aug
13
revised Get the window height
added 12 characters in body
Aug
1
comment JavaScript find element by text
+1 with a sidenote that getElementsByTagName is faster than querySelectorAll, and also that you can just call Array.prototype.filter.call(collection, filterElements), making the call to slice() redundant.
Aug
1
revised JavaScript find element by text
added 2 characters in body
1 2 3 4 5