Why can’t I use a Javascript function before its definition inside a try block?

Firefox interprets function statements differently and apparently they broke declaration hoisting for the function declaration. ( A good read about named functions / declaration vs expression ) Why does Firefox interpret statements differently is because of the following code: if ( true ) { function test(){alert(“YAY”);} } else { function test(){alert(“FAIL”);} } test(); // should … Read more

Firefox 6 Infinite Page Refresh With Page With Hash Tags

Turns out, this is an issue with an old version of MicrosoftAjax.js (the one that comes installed with Asp.Net MVC 2). Open up the MicrosoftAjax.debug.js file and check the file version number. The top of this file will look like this if this is your problem: // Name: MicrosoftAjax.debug.js // Assembly: System.Web.Extensions // Version: 4.0.0.0 … Read more

Image scaling by CSS: is there a webkit alternative for -moz-crisp-edges?

WebKit now supports the CSS directive: image-rendering:-webkit-optimize-contrast; You can see it working in action using Chrome and the last image on this page: http://phrogz.net/tmp/canvas_image_zoom.html The rules used on that page are: .pixelated { image-rendering:optimizeSpeed; /* Legal fallback */ image-rendering:-moz-crisp-edges; /* Firefox */ image-rendering:-o-crisp-edges; /* Opera */ image-rendering:-webkit-optimize-contrast; /* Safari */ image-rendering:optimize-contrast; /* CSS3 Proposed */ … Read more

Programmatical click on -tag not working in Firefox

In Firefox, you can explicitly add the created element to the DOM and it will work: $(‘body’).on(‘click’, ‘#test’, function(event) { var link = document.createElement(‘a’); // Add the element to the DOM link.setAttribute(“type”, “hidden”); // make it hidden if needed link.download = ‘test.xls’; link.href=”https://stackoverflow.com/questions/32225904/data:application/vnd.ms-excel;utf-8,test”; document.body.appendChild(link); link.click(); link.remove(); }); Fiddle

Handling connection loss with websockets

You have to add ping pong method Create a code in server when receive __ping__ send __pong__ back JavaScript code is give below function ping() { ws.send(‘__ping__’); tm = setTimeout(function () { /// —connection closed /// }, 5000); } function pong() { clearTimeout(tm); } websocket_conn.onopen = function () { setInterval(ping, 30000); } websocket_conn.onmessage = function … Read more

unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)

[Update – this can (was for me) still be a fix for this issue in 2015 |mdurrant|] I came across this problem lately. You should upgrade to capybara v1.0.1 to have a correct selenium webdriver. To be sure I added: gem ‘selenium-webdriver’, ‘2.25.0’ in my Gemfile. Important note: The selenium-webdriver gem is updated, and a … Read more