Skip to content
Advertisement

Difference between document.documentElement.clientHeight and document.body.clientHeight

What is the difference between document.documentElement.clientHeight and document.body.clientHeight? Are the return values consistent across all web browsers or does each evaluate them differently? In my particular case, the documentElement seems to have a smaller height than the body element, which does not make sense. Why does this happen? Answer The document.documentElement property gives you the html element, while the document.body

jQuery input value change detection

How to detect was input value changed or not on blur event? For example every input field have default value (can be empty), after current input loses it’s focus we should determine, have the value been changed. How to do this? Answer compare the value and the defaultValue

Input Fires Keypress Event Twice

This question has been asked/answered (mostly) before, BUT I’ve tried three things to stop the event from bubbling but nothing has worked: (return false should take care of the other two, correct?) Here’s the html: And the JS (UPDATE CLEANED UP): }); I left the redundant stoppers in there but really shouldn’t return false simply kill the bubbling? (using Chrome).

Video tag not working in Safari now

The code below makes the video tag work in IE9, Chrome and Firefox. However I cant get it to work in Safari So for Safari, I tried this, Still doesn’t work. I did paste the url directly into a Safari address bar and it did bring back the video and play it. Any ideas on how to get the html5

When to use NodeIterator

Benchmark compares QSA & .forEach vs a NodeIterator Now either NodeIterator’s suck or I’m doing it wrong. Question: When should I use a NodeIterator ? In case you don’t know, DOM4 specifies what NodeIterator is. Answer It’s slow for a variety of reasons. Most obviously is the fact that nobody uses it so quite simply far less time has been

Google maps Places API V3 autocomplete – select first option on enter

I have successfuly implemented Google Maps Places V3 autocomplete feature on my input box as per http://web.archive.org/web/20120225114154/http://code.google.com:80/intl/sk-SK/apis/maps/documentation/javascript/places.html. It works nicely, however I would love to know how can I make it select the first option from the suggestions when a user presses enter. I guess I would need some JS magic, but I am very much new to JS and

Advertisement