Questions tagged [cross-browser]

Cross-browser development refers to the practice of building web sites, web applications, libraries, or components so that they function across different web browsers and rendering engines.

Cross-browser development refers to the practice of building web sites, web applications, libraries, or components so that they function across different web browsers and rendering engines. This contrasts with the concept of developing for one browser or engine.

9067 questions
356
votes
21 answers

How to Detect Browser Back Button event - Cross Browser

How do you definitively detect whether or not the user has pressed the back button in the browser? How do you enforce the use of an in-page back button inside a single page web application using a #URL system? Why on earth don't browser back…
351
votes
13 answers

Remove Safari/Chrome textinput/textarea glow

I am wondering if its possible to remove the default blue and yellow glow when I click on a text input / text area using CSS?
Alec Smart
  • 94,115
  • 39
  • 120
  • 184
308
votes
5 answers

How do I disable text selection with CSS or JavaScript?

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, the text of the button is selected, and…
daviddarx
  • 3,485
  • 3
  • 20
  • 23
300
votes
10 answers

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…
294
votes
15 answers

'innerText' works in IE, but not in Firefox

I have some JavaScript code that works in IE containing the following: myElement.innerText = "foo"; However, it seems that the 'innerText' property does not work in Firefox. Is there some Firefox equivalent? Or is there a more generic, cross…
Ray
  • 187,153
  • 97
  • 222
  • 204
290
votes
33 answers

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…
erikkallen
  • 33,800
  • 13
  • 85
  • 120
283
votes
19 answers

OnChange event handler for radio button (INPUT type="radio") doesn't work as one value

I'm looking for a generalized solution for this. Consider 2 radio type inputs with the same name. When submitted, the one that is checked determines the value that gets sent with the form:
Matthew
  • 8,183
  • 10
  • 37
  • 65
257
votes
21 answers

Creating rounded corners using CSS

How can I create rounded corners using CSS?
Eldila
  • 15,426
  • 23
  • 58
  • 62
245
votes
9 answers

How can I draw vertical text with CSS cross-browser?

I want to rotate a single word of text by 90 degrees, with cross-browser (>= IE6, >= Firefox 2, any version of Chrome, Safari, or Opera) support. How can this be done?
usr
  • 168,620
  • 35
  • 240
  • 369
244
votes
15 answers

How is the default submit button on an HTML form determined?

If a form is submitted but not by any specific button, such as by pressing Enter using HTMLFormElement.submit() in JS how is a browser supposed to determine which of multiple submit buttons, if any, to use as the one pressed? This is significant…
Stewart
  • 3,935
  • 4
  • 27
  • 36
242
votes
11 answers

Cross-browser window resize event - JavaScript / jQuery

What is the correct (modern) method for tapping into the window resize event that works in Firefox, WebKit, and Internet Explorer? And can you turn both scrollbars on/off?
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
237
votes
4 answers

How to make HTML Text unselectable

I would like to add text to my webpage as a label and make it unselectable. In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. A good example of what I'm trying to achieve is the…
Ben
  • 10,020
  • 21
  • 94
  • 157
230
votes
8 answers

browser sessionStorage. share between tabs?

I have some values in my site which I want to clear when the browser is closed. I chose sessionStorage to store those values. When tab is closed they are indeed cleared, and kept if the user presses f5; But if the user opens some link in a different…
Vladimir Gordienko
  • 3,260
  • 3
  • 18
  • 25
228
votes
14 answers

Failed to load resource under Chrome

There is a bunch of images in a web page. Other browsers do download them correctly, but Chrome doesn't. In the developer's console, it shows the following message for each image: Failed to load resource As mentioned before, problem appears only…
AntonAL
  • 16,692
  • 21
  • 80
  • 114
213
votes
6 answers

Truncating long strings with CSS: feasible yet?

Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout? I've been truncating server-side by logical width (i.e. a blindly-guessed number of characters), but since a 'w' is…
Sam Stokes
  • 14,617
  • 7
  • 36
  • 33