Read more

Download Blob as file in Javascript

While we are working with Javascript we may find our self in a situation where we need to let users download blob as File.
So In this post, I’ll share basic javascript function which allows us to download blob as a file in the browser.

read more Download Blob as file in Javascript


Difference between == and === in JavaScript

So we know in javascript we have == and === comparisons. Why two? What are the differences between them? So what is the difference between followings this returns true. when it comes === equals this returns false. So what it is? The triple-equals comparator compares both type and contents So ‘1’ === 1 contains string value and int value. Even contents are same they are in different types. So it is not equals. Double equals tries to help with type coercion. But it’s not always the help we want. So keep in mind when you are using above equal comparisons.  

let run long runing task in background in javascript

So When I am in javascript development I had a long running javascript method which delays page loading. So I wanted to make it run in background to protect responsiveness of application. So I found Differed execution in Jquery.  Using differed execution we can run functions in background and do another stuffs as we want. And we can pass callback function to execute on after finishing the long running function. Code Sample on jsfiddle

Bind javascript array or object to html drop down in Jquery

So when we are in developing we have to populate dropdown box with javascript objects. Some times we have to write more dirty codes to do that. I am using following Jquery function to populate dropdown box with javascript array or object. So if we want to bind following array to drop downbox simply we can add html attribute as below and call the above function <select id=”test”></select>  Now it will be populated. More over we can bind list of following object Further we can provide whether to show default “–None–” or set selected index using ending two parameters in function. Just only pass true or false.