Thursday, August 27, 2015

How to disable in Chrome, Mozilla Firefox, Safari and IE


Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.

That can be extremely handy for development - when your page partly loads data from you main dev server and some API or resources are received from your local server with mocked APIs for example.

Below there instructions how to enable cross-domain requests (in other words disable default CORS policy) in all major browsers: Chrome, Mozilla Firefox, Safari and IE.

Monday, July 20, 2015

jQuery events triggers (mouse, keyboard, touchscreen) cheatsheet

jQuery :contains Case-Insensitive custom selector

Regular jQuery('div:contains("' + MY_TEXT + '")') for selecting nodes that contain specific piece of text is case sensitive by default. So when you try to perform for example text search in a list of blocks or the whole page - the following case insensitive modified selector can be extremely handy.

jQuery.expr[':'].containsi = function (a, i, m) {
    var sText   = (a.textContent || a.innerText || ""); 
    var zRegExp = new RegExp (m[3], 'i');
    return zRegExp.test (sText);

from :

Wednesday, July 8, 2015

ReactJS links and information collection

Open-source Javascript library for creating user interfaces developed by Facebook team. Its initial release was in 2013, and stable version was only in late 2014 (0.12.2). It has soft learning curve, thanks to simple idea of encapsulated UI-elements-and-JS-components communicating to each other using set of defined ways. ReactJS production is ~128 KiB.

First, to read

Saturday, May 23, 2015

Translation JSON APIs

While building my web-app for adding and learning new words vocEverywhere I've decided to integrate some freely available translator API so that in most case you won't need to use separate translator (in browser tab or as an app) first and the copy-paste the results to vocEverywhere.

Doing a bit of googling I came across quite a big list with variety of translation APIs available -