How can I prevent the backspace key from navigating back?

On IE I can do this with the (terribly non-standard, but working) jQuery if ($.browser.msie) $(document).keydown(function(e) { if (e.keyCode == 8) window.event.keyCode = 0;}); But is it possible to do in a way which works on Firefox, or in a cross-browser way for a bonus? For the record: $(document).keydown(function(e) { if (e.keyCode == 8) e.stopPropagation(); … Read more

How do I disable text selection with CSS or JavaScript? [duplicate]

This question already has answers here: How to disable text selection highlighting (50 answers) Closed 1 year ago. I am making a HTML/CSS/jQuery gallery, with several pages. I indeed have a “next” button, which is a simple link with a jQuery click listener. The problem is that if the user click the button several times, … Read more

How to fix Array indexOf() in JavaScript for Internet Explorer browsers

If you have worked with JavaScript at any length you are aware that Internet Explorer does not implement the ECMAScript function for Array.prototype.indexOf() [including Internet Explorer 8]. It is not a huge problem, because you can extend the functionality on your page with the following code. Array.prototype.indexOf = function(obj, start) { for (var i = (start || 0), … Read more

What is WebKit and how is it related to CSS?

More recently, I have been seeing questions with the tag “webkit”. Such questions usually tend to be web-based questions relating to CSS, jQuery, layouts, cross-browers compatibility issues, etc… So what is this “webkit” and how does it relate to CSS? I have also noticed a lot of -webkit-… properties in the source code for various … Read more

What requests do browsers’ “F5” and “Ctrl + F5” refreshes generate?

Is there a standard for what actions F5 and Ctrl+F5 trigger in web browsers? I once did experiment in IE6 and Firefox 2.x. The F5 refresh would trigger a HTTP request sent to the server with an If-Modified-Since header, while Ctrl+F5 would not have such a header. In my understanding, F5 will try to utilize … Read more