Blog
POW Answer – JavaScript Self Inequality
As two people indicated in their comments in the original POW post, the answer is NaN. You can even do the following to check it: Weird stuff, right?!?!?!
As two people indicated in their comments in the original POW post, the answer is NaN. You can even do the following to check it: Weird stuff, right?!?!?!
Assuming a normal JavaScript engine, what could you possibly pass into the following mystery() function that would not thrown an error? As is normal, this answer will be shown a week from when it was posted and will be linked Read more…
One of the supposedly evil things that is available in jQuery is eval. The type of eval that is available is of the global variety. In other words globalEval provides the ability to execute JavaScript code from a string in Read more…
One DOM element property that has been provided in Internet Explorer that isn’t natively available in some other browsers is outerHTML. Fortunately there is a cross-browser solution for getting this property: I actually can’t take the credit for this function Read more…
One of the things that is in the new version of jPaq is simple AJAX handling. The way that I accomplished it was by using code similar to the following: The above code basically provides a function called requestContentFrom(...). This Read more…
Recently I was asked to add an HTML code snippet containing external CSS and JS to a few different web pages. After having the code tested, of course Internet Explorer was the browser that caused me an issue. The stylesheets Read more…
Iterating through the key-value pairs of an object that one has created is a task often executed. In view of this, I wrote the following code as a quick and easy way to iterate through all of the keys using Read more…
One of the nice things that many people don’t know about JavaScript String replace() function is the fact that the second parameter can either be a string or a callback function. This callback function receives the entire matched substring, each Read more…
Sometimes you may have to use Textwrangler, SublimeText, Notepad++, or whatever IDE to search for a string which contains something commonly found outside of a string. For example, what if you want to find a string that in a Python Read more…
If you create a regular expression and set its global flag to true, it is important to note that if you want to test multiple strings against that RegExp using the test() function you will most-likely want to zero out Read more…