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 …
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
Automatically convert two dashes into an — in TinyMCE
I’m looking for a TinyMCE plugin or other custom solution which will convert — into — automatically. Ideally the solution would not require processing the entire TinyMCE contents on every keyPress/keyUp event, but instead only check when the user has either cut, pasted, or typed -. Right now IR…
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 real…
Javascript: Programmatically scroll non-popup SELECT element to bottom in Chrome
I have a SELECT element in a web page, and I’d like it to load scrolled to the bottom. In most browsers, I can do this: Although scrollHeight is out of bounds, the browsers figure that out and limit it appropriately. Except in Google Chrome. I could file a bug report, but that doesn’t help me with…
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 …
How do I calculate the date in JavaScript three months prior to today?
I Am trying to form a date which is 3 months before the current date. I get the current month by the below code Can you guys provide me the logic to calculate and form a date (an object of the Date data type) considering that when the month is January (1), 3 months before date would be OCtober (10)?
How to perform a Javascript object recursive search that match my needs?
Good day, I am working on a text-based games written in Javascript. I have variable named map that is an associating object containing another object for each rooms. I have found a little algorithm somewhere and I am not sure how to modify it for my specific task. My variable: I would like the function to ret…
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 optio…