Andy E

United Kingdom

whattheheadsaid.com

Age: 31

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

1d
comment background-position-y doesn't work in Firefox (via CSS)?
@BoltClock: It's under consideration by Microsoft, with a fair few votes behind it, and development just (re)started for Chrome. However, for this particular use case, CSS variables can be employed today, as the only browser that implements them is the only one that needs them to simulate background-position-x/y.
1d
answered background-position-y doesn't work in Firefox (via CSS)?
2d
comment JSHINT: The __proto__ property is deprecated
why not just Object.prototype.hasOwnProperty.call(obj, prop)?
2d
comment JSHINT: The __proto__ property is deprecated
__proto__ isn't supported in IE 8 either, so no fallback necessary unless ancient webkit/firefox/opera support is required.
Mar
23
comment Javascript: How to loop through ALL DOM elements on a page?
@JesseAldridge: just a force of habit/good practice. Avoiding the property lookup on every iteration is usually a micro-optimisation, but it's not particularly more difficult to write and so I just do it naturally.
Mar
22
comment re-sizing shadow DOM elements based on width/height style of the custom element
+1, looks like I also need to brush up on my CSS as I didn't expect it to be this easy! You should mark your answer as accepted.
Mar
19
awarded Good Answer
Mar
18
awarded Popular Question
Mar
18
awarded Great Answer
Mar
16
comment Why don't self-closing script tags work?
it's unclear as to the main reason the proposal was rejected as the discussion ends pretty abruptly, although breaking existing browsers with new code was one of the issues raised. I'm just pointing out that <script> would be unique as a HTML5 element that is permitted to be self-closing. What I meant in my first comment was that backwards compatibility is not harmed, because backwards compatibility refers to old code running in newer browsers – which is fine in this instance.
Mar
14
comment Why don't self-closing script tags work?
"Self-closing <script> does not happen in HTML 5 because of backward compatibility." – this isn't really true as no aspect of backward compatibility would be broken, that is, code that has been written would still continue to work in newer browsers that supported a self-closing <script>. The real reason is that <script> would be the only self-closing tag as HTML doesn't define any others. Also, only foreign tags are permitted to be self-closing, as void tags do not have an end tag. See start tags, step 6.
Mar
9
awarded Guru
Mar
8
comment Access object child properties using a dot notation string
@user1912899: that's not quite the same, but is probably a little more robust in that it will throw errors (whereas mine will just return undefined). It depends on your preference, I suppose. JSHint just complains about the assignment in the loop conditional, which can be disabled using the boss option.
Mar
2
answered Empty files uploaded in Android Native browser
Feb
24
comment How can I highlight the line of text that is closest to the mouse?
@Alex: the example I wrote was merely a proof of concept, there should be no reason why it couldn't be adapted to account for scroll offset.
Feb
23
comment What does jQuery.fn mean?
@slier: yes, pretty much.
Feb
20
awarded Yearling
Feb
16
revised Javascript regex, replace all characters other than numbers
added 1 character in body
Feb
14
awarded Notable Question
Feb
10
awarded Generalist
1 2 3 4 5