Questions tagged [fallback]

A fallback is a design pattern useful in situations, when certain advanced functionality may be used only if certain conditions are met. If the conditions cannot be fulfilled, algorithm reverts to the so-called fallback function, which achieves the goal using less sophisticated methods.

508 questions
414
votes
6 answers

What is the meaning of polyfills in HTML5?

What is the meaning of polyfills in HTML5? I saw this word in many sites about HTML5, e.g. HTML5-Cross-Browser-Polyfills. So here we're collecting all the shims, fallbacks, and polyfills in order to implant HTML5 functionality in browsers that…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
160
votes
10 answers

How to load local script files as fallback in cases where CDN are blocked/unavailable?

I’m using a CDN for the following…
raklos
  • 28,027
  • 60
  • 183
  • 301
45
votes
8 answers

Catch any error in Python

Is it possible to catch any error in Python? I don't care what the specific exceptions will be, because all of them will have the same fallback.
user825286
39
votes
3 answers

WPF Binding FallbackValue set to Binding

Is there a way to have another binding as a fallback value? I'm trying to do something like this:
HaxElit
  • 3,983
  • 7
  • 34
  • 43
38
votes
6 answers

How to use the I18n fallback features in Rails 3

I am getting an "translation missing" error message from Rails 3: activerecord: notices: messages: success: create: "Something was created" models: user: success: create: "Thanks for…
35
votes
2 answers

CSS calc not working in Safari and fallback

I have this layout I am working on. It strongly depends on CSS calc to do the necessary calculations. width: -webkit-calc(50% - 20px); width: -moz-calc(50% - 20px); width: calc(50% - 20px); Now, I can't get this to work in Safari. Is there…
Nikk
  • 7,384
  • 8
  • 44
  • 90
35
votes
2 answers

Fallback image and timeout - External Content. Javascript

What is the best way to set up a local fallback image if the external image does not load or takes too long to load.
Boris Smirnov
  • 1,217
  • 4
  • 15
  • 27
27
votes
3 answers

What should I use instead of the deprecated `onerror` attribute?

On my images I'm setting the onerror attribute so that a placeholder is used in case the image is not available for some reason: some description
Stefano
  • 555
  • 1
  • 5
  • 18
24
votes
4 answers

How to write css fallbacks for vh vw

Can anyone explain how fallbacks work in CSS? I am trying to set it up for vh and vw and clearly I am not getting it... Here is my attempted solution, which does not work. The height property is taken every time. CSS: -webkit-height:…
user3311351
  • 301
  • 1
  • 2
  • 9
23
votes
3 answers

flash fallback video black screen - no video, only audio media element

I just downloaded mediaelement.js from http://mediaelementjs.com. Looks really good. Though in the demo files, the videos won't play in IE 8. The player is showing a black screen, but I can hear the audio. I have also tried installing on a server…
Chemi
  • 283
  • 3
  • 8
21
votes
4 answers

Detect if Angular dependencies [angular-route, angular-resource, etc] are loaded for CDN fallback

I'm using Angular JS on ASP.NET MVC 4 and I am using script bundles to load from a cdn and also load from the origin server in case of a cdn failure like so: var jQuery = new ScriptBundle("~/bundles/scripts/jquery", …
Mike Trionfo
  • 1,127
  • 7
  • 11
21
votes
3 answers

Return a default value if single row is not found

I have the following select statement to grab the next scheduled item for a stream. If there is no matching row, I want it to return a default value. Here's the SQL that I'm using: SELECT `file` FROM `show`, `schedule` WHERE `channel` = 1 AND…
Fibericon
  • 5,684
  • 12
  • 37
  • 64
19
votes
0 answers

Fallback for WebP poster in video tag, how?

I would use poster in WebP format, how I can make fallback to JPG for browsers that don't support WebP?
Vlad
  • 191
  • 1
  • 5
18
votes
4 answers

JavaScript Variable fallback

Please can someone explain to me what this line of code does: var list = calls[ev] || (calls[ev] = {}); My best guess: It's setting the variable "list" with the value of calls.xxx, where xxx is a variable, ev. If calls[ev] doesn't exist, then it's…
thugsb
  • 22,856
  • 6
  • 30
  • 44
15
votes
2 answers

Is there any good fallbacks for HTML5 and CSS3?

I'm looking for a good fallback for both HTML5 and CSS3 so I could use it and it would still look ok in other browsers.
josterberg
  • 153
  • 6
1
2 3
33 34