Events is a great technique to loose code coupling. JS Custom Events was a big step to help the front-end developers write better JS. Despite this there are many cases where you don’t have your app objects represented in the DOM tree. And do you always have to trigger this event to the DOM when you don’t actually… Continue reading JavaScript Custom Events that are not DOM related
Category: JS
Leaflet tiles: Failed to load resource: the server responded with a status of 403 (Forbidden)
If you recently encounter a 403 error for your Leaflet tiles and your map is just showing gray it’s most likely that you’re using the tiles from Cloudmade which decided to discontinue their MapTile service for non-enterprise users. The easiest way to fix it is to change the cloudmade tile url: var tileUri = ‘http://tile.cloudmade.com/APIKEY/88233/256/{z}/{x}/{y}.png’; With… Continue reading Leaflet tiles: Failed to load resource: the server responded with a status of 403 (Forbidden)
jQuery error .apply( matched.elem, args ); undefined is not a function
If you’re having an error in your site/app that says that is undefined is not a function and the error happens on the row containing .apply( matched.elem, args ); (jquery.js:4676 for version 2.0.3). You can do the following 2 things to figure out the error: 0. You need Chrome Dev Tools 1. Enable async for your dev… Continue reading jQuery error .apply( matched.elem, args ); undefined is not a function
It’s time to stop fooling ourselvs with touch device detection
To all you JS guys out there: It’s time to stop fooling ourselves. The fact that a user has a touch capable device doesn’t mean he’ll be using it with touch only. Not sure what I’m talking about? There you go: var clickEventToUse = ( ‘ontouchstart’ in window ? ‘touchend’ : ‘click’ ) Still not sure? Now… Continue reading It’s time to stop fooling ourselvs with touch device detection
Making async ajax calls to an array of url’s and processing their responses at once
Today I had a very interesting case where we needed to get a specific amount of SVG files with ajax calls that were to be processed once after all of the requests are done. I was familiar with the $.when and used it before but only in casese where the number of the calls were… Continue reading Making async ajax calls to an array of url’s and processing their responses at once
A new async callstack have landed in Chrome Canary
If you’re using Chrome Canary for your development work now you can find a asyc radio button next to the callstack when you stop on a breakpoint in the DevTools. Enabling it adds the functions that triggered an asynchronous action that called in the end the function you’ve your breakpoint in. The awesome about this is… Continue reading A new async callstack have landed in Chrome Canary
Adding a custom attribute to an existing sencha touch component (and why it might cause error after production build)
Lately we’ve been using Sencha Touch for an interesting project. We found a problem which something was working correctly while on develop mode but stopped working after the app was built for production. Turned out the problem was becuase we added a custom attribute to an existing sencha component which we wanted to use. Ext.define(‘SomeView’,… Continue reading Adding a custom attribute to an existing sencha touch component (and why it might cause error after production build)
Google I/O Extended Sofia 2013 – Ease Your Dev Life with Chrome Dev Tools
I’ll be giving a talk about how to ease your dev life with Chrome Dev Tools today (15 May 2013) at 17:00 in SOHO Sofia See you there 🙂
JS Date object and iOS Safari
Safari on iOS is probably one of the best mobile browsers. Still there is one thing that I often got wrong and wonder why my webapp doesn’t work. Javascript Date Object in iOS Safari In every normal browser you could just create a Date object from string as var myDate = new Date(‘2013-01-21T13:46:20’); But on… Continue reading JS Date object and iOS Safari