2014
Apr
22

@font-face is for loading up and using your own custom fonts, rather than the limited set of standard system fonts already installed on computers that browsers have access to. For security reasons, Firefox or Internet Explorer simply don't allow you to use by default a font that is not hosted on your domain, not even on your subdomain. The CDN based websites can be also affected in this case.

2014
Mar
27

The first digit (a) is always zero, unless there is a inline style attribute applied to that element. The second digit (b) is the sum of the number of IDs in that selector. The third digit (c) is the sum of the number of classes, attributes, and pseudo-classes in that selector. The fourth digit (d) counts the elements and pseudo-elements.

2014
Mar
25

The postMessage API is supported by all modern browsers including IE8. It allows windows/frames from multiple domains to communicate with each other. IE8 doesn't allow to postMessage to other windows, only to iframes. Cross-window messaging security model is two-sided. The sender ensures that the receiving domain is targetDomain. The receiver checks that the message came from proper event.origin.

2014
Mar
14

Based on the library bootstrap model and jstree, I built the library Treeview to select a file from the file cabinet and do copy or move.

2014
Mar
11

Render TV list data, set the cursor focus on the item, and go on the next when pressing the Enter key. Y.TVList doesn't deal with any style with CSS. Users have to handle on their own.

2014
Mar
10

Preloading images is a great way to improve the user experience. When images are preloaded in the browser, the visitor can surf around your site and enjoy extremely faster loading times. This is especially beneficial for photo galleries and other image-heavy sites where you want to deliver the goods as quickly and seamlessly as possible. Preloading images definitely helps users without broadband enjoy a better experience when viewing your content. In this article, we’ll explore three different preloading techniques to enhance the performance and usability of your site.

2014
Mar
09

The load event is a general “loading complete” signal. It is supported by many elements. For example, external SCRIPTand IMG, IFRAME trigger it when downloading of their content finishes. The handler window.onload and iframe.onload triggers when the page is fully loaded with all dependent resources including images and styles. The DOMContentLoaded event triggers on document when the page is ready. It waits for the full HTML and scripts, and then triggers.

2014
Mar
06

ECMAScript 5's Function.prototype.bind is a great tool that's implemented in all modern browser JavaScript engines. It allows you to modify the context, this, of a function when it is evaluated in the future. Here's a common use case that developers need to watch for. Turns out that since we added the event listener to the window object, this in the event handler or callback refers to window.

2014
Mar
05

If the function is able to assign values to its parameters, only its local copy is assigned — that is, anything passed into a function call is unchanged in the caller’s scope when the function returns. Pass-by-reference typically means that the function can modify (i.e. assign to) the variable used as argument — something that will be seen by its caller.

2010
Oct
03

The href attribute is different to other element attributes in that the value set can be relative to the context of the page URL. The browser will look at the pages current URL and derive an absolute URL for the link. This is the root of the problem, some browsers return the text of the attribute and others(IE6/IE7) return the derived absolute URL.