I see this mistake way more often than I should. Someone adds an event listener with an anonymous function callback to an element (like a button) then puts it in a a function that may get called multiple times. While this very common setup may seem harmless, it can create some serious issues.
The problem is this setup will add multiple listeners to the element, a new one each time the function is called, meaning three calls will add three listeners, then when the event is triggered the callback will be run three times. This JSFiddle demo clearly shows the scenario in action.
Continue reading “JS – Avoid duplicating addEventListener()”
I came across this little snafu yesterday while working on my capstone, which I was able to reproduce in all the major browsers.
If your form has any form of
<button> with a
name attribute of “submit” (
name="submit"), it will override the
.submit() method and throw an error when you try to call it (as I do in the same code above)!
Internet Explorer 11
Changing the attribute’s value to anything else, even “form-submit”, will prevent the method from being overwritten. So be aware of what you
name those inputs! They could introduce some pretty nasty bugs! It took me a bit to track this down because it was behavior I did not expect!
If you own a smart phone, tablet, “phablet” or follow the tech industry at all, you will have heard this one word used over and over again in a ton of blog posts (including this one), news articles, and pretty much anything else you can think of:
In the context of phones, tablets, and the like, fragmentation is defined in a basic form as:
Fragmentation is the result of many generations of smartphones or tablets running various versions of the same operating system.
While fragmentation has been primarily used in reference to Android and iOS, it is also present in Windows, Mac OS X, and Linux operating systems, though it is not near as severe there as it is in mobile devices. Further, fragmentation does not occur solely in the core of an operating system (arguably the worst kind), it can occur to any form of software. For example, Niels Leenheer wrote an excellent article on Android web browser fragmentation.
Continue reading “Android version fragmentation needs fixing”
There is something I have been thinking about lately, and I would love it if you, my readers, would express your opinion on the matter. 🙂
As you may know, I recently celebrated four years on WordPress. This blog was some of my first real exposure to the Web. Though at times it has been hard for me to publish anything, I have blogged long enough that I feel guilty if I do not publish something on a consistent basis. I enjoy blogging and only wish I had more time to write out all my thoughts, observations, and experiences as primarily related to programming and website development.
Continue reading “Possible move from WordPress.com?”
On the morning of 10 October, I tired of working on my capstone and had finished contributing a patch to an open-source project, I decided I needed a small, fun, project to quickly create as a change of pace. A few minutes later, either inspirational or pure randomness stuck: recreate Windows Notepad.
According to the documentation,
defer a script?), so I wrote my own function using the basic idea of that snippet, which is the topic of this article. 🙂
Today is 13 of October, 2015. Today is a very special day, for today marks the four year anniversary of this blog! 😀 Well, actually yesterday marked the 4th anniversary, but I have never seemed to be able to get that date right, so one day late is close enough. 😛
It has been a great four years and I look forward to the next four (and beyond) years. I may not still be using this domain and WordPress in four years, nor may my writings be the same as they are now in style or topic, but I do know I will continue to write on whatever topics I write on, for it is something I enjoy and hopefully you enjoy reading.
So thank you, my readers. Thank you for giving me the motivation I need to continue writing. Thank you for reading what I write and commenting on the article with your thoughts and questions. Without your support I would not be writing (and you not reading) this milestone post. 🙂
Now to God be the glory for gifting me the knowledge, talent, and abilities to work and labor for His honor,