What are source maps in CSS and JavaScript?

CSS3 on MoreOnFew.com

With all the optimization techniques like bundling and minification etc getting important and popular it is good that we talk about Source Maps now. Think of this, once you bundle all the CSS files you have into one single file, how do you know which part of CSS was written in which file? To make … Read more

How to empty an array in JavaScript ?

Javascript on MoreOnFew.com

Arrays are widely and commonly used in JavaScript. Especially if you are developing a dynamic app, there are very high chances that you might use Arrays in JavaScript. However, many a times I’ve noticed that people don’t use the Array related methods properly and end up doing certain things in a wrong way. One such … Read more

How to fix Load Timeout for Modules Error in RequireJs

Javascript on MoreOnFew.com

RequireJs is a very helpful JavaScript Module Loader. If you’ve been working on BackboneJS, AngularJs, or KnockoutJs you would have most likely come across RequireJs. Also, it is very likely that while working with RequireJs you would have come across the Error : Load timeout for modules message. The possible causes for this error Load timeout for … Read more

How to remove multiple attributes in jquery?

jQuery Banner

Many a time you might have come across a scenario where you would want to remove multiple attributes from an element. For example, consider the following DIV : Now using jQuery’s removeAttr() method you want to remove both the data-id and data-module attributes. Many of us try to use multiple calls to the removeAttr() method … Read more

How to join or merge an Array in JavaScript?

Javascript on MoreOnFew.com

I’m sure you must have had a scenario where you had to join or merge two different Arrays. Well, let me tell you that its an easy task. However, there are different ways this can be done. Merging multiple arrays using Array.concat() method. JavaScript has a native method Array.concat() which does it. Let’s take a look … Read more

How to search for a string in JavaScript?

Javascript on MoreOnFew.com

The String data type must be the most common data type that we use in JavaScript. One of the most common functionality around string that we would have come across is to search for a string/character/word within another string. You can easily search for a word in javaScript using the string.search() method of JavaScript. The … Read more

How to use Crossroads.js? A tutorial with examples

Javascript on MoreOnFew.com

Are you making a Single Page Application  or an SPA ? And Do you want to update the URL of the page without reloading the page? Do you want your page to respond to the change in the URL without reloading the page? In Short, if you are looking for a javascript routing library then … Read more

How to check jQuery version?

jQuery Banner

Many of us might have come across scenarios wherein we wanted to do something based on the version of the jQuery loaded. To be specific I’m talking about scenarios where one might want to know the version of jQuery programmatically and if the version was say 1.3.2 then load some other files too or do something … Read more