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
65
votes
6 answers

Math.round(num) vs num.toFixed(0) and browser inconsistencies

Consider the following code: for (var i = 0; i < 3; i++) { var num = i + 0.50; var output = num + " " + Math.round(num) + " " + num.toFixed(0); alert(output); } In Opera 9.63 I get: 0.5 1 0 1.5 2 2 2.5 3 2 In FF 3.03 I get: 0.5 1 1 1.5…
eft
  • 2,509
  • 6
  • 26
  • 24
65
votes
8 answers

Same font except its weight seems different on different browsers

The text is correctly displayed in Chrome. I want it to display this way in all browsers. How can I do this? I was able to fix this in Safari with -webkit-font-smoothing: antialiased; Chrome: Firefox: h1 { font-family: Georgia; …
seymar
  • 3,993
  • 6
  • 25
  • 30
65
votes
6 answers

Detecting an image 404 in Javascript

After a user uploads a file we have to do some additional processing with the images such as resizing and upload to S3. This can take up to 10 extra seconds. Obviously we do this in a background. However, we want to show the user the result page…
Tobias Lütke
  • 1,028
  • 1
  • 9
  • 9
65
votes
8 answers

Remove padding for an empty element

I'm generating a page for an upcoming portal site, and I've got an HTML element with some optional content. I'd like the element to not render if it is empty, but adding some padding to it causes it to render. How do I add padding to the content,…
Eric Falsken
  • 4,796
  • 3
  • 28
  • 46
65
votes
3 answers

Javascript: document.execCommand cross-browser?

I just stumble on a piece of code which I never saw before: document.execCommand('Copy'); which seems to copy the clipboard contents to the element in focus. Is this functionality available cross-browser? I found a page that shows a compatibility…
jldupont
  • 93,734
  • 56
  • 203
  • 318
63
votes
11 answers

Cross-browser method for detecting the scrollTop of the browser window

What is the best cross-browser way to detect the scrollTop of the browser window? I prefer not to use any pre-built code libraries because this is a very simple script, and I don't need all of that deadweight.
Hot Pastrami
63
votes
18 answers

What Cross-Browser issues have you faced?

While developing for multiple sets of browsers, what issues have you faced while development due to differences in browser implementation? To start with I am listing some of those which i faced: A text node in Firefox allows only 4K data. So an XML…
Navneet
  • 11,187
  • 4
  • 21
  • 22
63
votes
9 answers

remove borders around html input

I want to create a search function for my web app. here are the looks on FF & IE, it is ok without strange border Firefox IE and here are the look on Chrome & Safari, it has strange border around the input element Chrome Safari Here is my html &…
Timeless
  • 7,338
  • 9
  • 60
  • 94
62
votes
9 answers

.SVG Browser Support

I'm working on a responsive design and I'm thinking of creating navigation icons as .svg files. What is current browser support like and is there a workaround/plugin for older browser versions?
Jedda
  • 1,007
  • 5
  • 14
  • 26
62
votes
7 answers

Can I add attributes to 'window' object in javascript?

Can I add any random attribute to 'window' object in javascript? Some thing like: window.my_own_attr = "my_value" Does it have any side effects with any libraries? And is it cross-browser compatible?
akkishore
  • 1,070
  • 1
  • 9
  • 17
61
votes
3 answers

CSS - max z-index value

Is there a maximum / minimum possible value for the CSS z-index property? Do different browsers have different maximum / minimum accepted values? How will browsers handle a high / low value? I thought I read somewhere once about a max z-index…
Web_Designer
  • 72,308
  • 93
  • 206
  • 262
61
votes
11 answers

Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?

What are the existing client-side architectures to access a local Smart Card thru a PC/SC Smart Card reader (ISO 7816-3, ISO 14443) from a generic browser (connected to a server through http(s)), preferably from Javascript, with the minimum…
fgrieu
  • 2,724
  • 1
  • 23
  • 53
61
votes
11 answers

“text-decoration” and the “:after” pseudo-element, revisited

I'm re-asking this question because its answers didn't work in my case. In my stylesheet for printed media I want to append the url after every link using the :after pseudo-class. a:after { content: " <" attr(href) ">"; text-decoration:…
palm3D
  • 7,970
  • 6
  • 28
  • 33
61
votes
7 answers

Proper way to detect WebGL support?

I am attempting to detect WebGL support across multiple browsers and I've encountered the following scenario. The current version of Firefox appears to report positive support using the following check, even when the visitor's video card is…
Derek Hunziker
  • 12,996
  • 4
  • 57
  • 105
60
votes
4 answers

How to make an HTML

Do you know how to make a
editable with JavaScript? I'm looking for cross-browser solution. Something similar to a rich text area, but that uses an editable