What do {curly braces} around javascript variable name mean [duplicate]

This question already has answers here: What is this JavaScript syntax: {Ci, CC}? [duplicate] (2 answers) Closed 6 years ago. EDIT After looking at JSHint I found this ‘destructuring expression’ is available in ES6 (use esnext option) or Mozilla JS extensions (use moz) and this however after reading it I still don’t understand why it … Read more

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

onchange event on input type=range is not triggering in firefox while dragging

When I played with <input type=”range”>, Firefox triggers an onchange event only if we drop the slider to a new position where Chrome and others triggers onchange events while the slider is dragged. How can I make it happen on dragging in Firefox? function showVal(newVal){ document.getElementById(“valBox”).innerHTML=newVal; } <span id=”valBox”></span> <input type=”range” min=”5″ max=”10″ step=”1″ onchange=”showVal(this.value)”> … Read more

jQuery $.ajax(), $.post sending “OPTIONS” as REQUEST_METHOD in Firefox

Having trouble with what I thought was a relatively simple jQuery plugin… The plugin should fetch data from a php script via ajax to add options to a <select>. The ajax request is pretty generic: $.ajax({ url: o.url, type: ‘post’, contentType: “application/x-www-form-urlencoded”, data: ‘{“method”:”getStates”, “program”:”EXPLORE”}’, success: function (data, status) { console.log(“Success!!”); console.log(data); console.log(status); }, error: … Read more

Why am I suddenly getting a “Blocked loading mixed active content” issue in Firefox?

This morning, upon upgrading my Firefox browser to the latest version (from 22 to 23), some of the key aspects of my back office (website) stopped working. Looking at the Firebug log, the following errors were being reported: Blocked loading mixed active content “http://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css” Blocked loading mixed active content “http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js”` among other errors caused by … Read more

Custom CSS Scrollbar for Firefox

I want to customize a scrollbar with CSS. I use this WebKit CSS code, which works well for Safari and Chrome: ::-webkit-scrollbar { width: 15px; height: 15px; } ::-webkit-scrollbar-track-piece { background-color: #c2d2e4; } ::-webkit-scrollbar-thumb:vertical { height: 30px; background-color: #0a4c95; } How can I do the same thing in Firefox? I know I can easily do … Read more

JavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”

I have been adding logs to the console to check the status of different variables without using the Firefox debugger. However, in many places in which I add a console.log in my main.js file, I receive the following error instead of my lovely little handwritten messages to myself: Synchronous XMLHttpRequest on the main thread is … Read more