Blog

POW – JavaScript Self Inequality

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 to from here.The answer to this POW can now be Read more…

By Chris West, ago
Blog

JavaScript – Global Eval

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 the global scope. Most people don’t realize it, but eval Read more…

By Chris West, ago
Blog

JavaScript – outerHTML

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 because it is derived from Google’s Closure Library. The function Read more…

By Chris West, ago
Blog

JavaScript – Read From A URL

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 function takes the URL of the content that you are Read more…

By Chris West, ago
Blog

JavaScript – Prepend DOM Node

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 that were added were taking precedence for the styling in Read more…

By Chris West, ago
Blog

CSS – Change Content On Hover

Today I saw a question about changing content without necessarily using JavaScript to do so. Recently I have had to do a little bit more with CSS and think of more solutions with JS. Thusly I came up with a somewhat elegant solution to replacing content on hover without JS: Read more…

By Chris West, ago