Blogs of jQuery

We are a web development and outsourcing agency based in Kochi, India.

jQuery deferred object and promises

  Deferred is a concept that can be hard to understand at first, but once you get a hold of it, it is extremely powerful and simple to use, just like any other jQuery function. So, I will try to explain it using an example and try to explain the concept first to see why we would use them at all. You have 10 ajax requests going on in a page and you need to trigger an alert after all of them are completed. There is no guarantee that they will be finished in order. Some may take a lot of time to execute while some may be fast. You have no trigger for this. This is where promises come into play. To put it simply, it is just an object which we can manipulate to trigger the completion of one or many asynchronous events (like ajax requests). A promise is a subset...

How to Style a Custom Select Box using CSS and Javascript

Yesterday we were working on a wordpress website, we installed a gravity form on our contact page and there was a select box has been fixed on that form. We have gone through the design and everything looks good, but the select boxes' arrows weren't matching with our website in its default style. We thought of a solution to fix this issue for sometime and at last we found that changing the select boxes custom design from default style is a solution for this. While implementing, we can see that this method works well with all modern browsers. Please find below code which helps you to resolve these type of issues. CSS .custom-select select { width: 480px; border: 1px solid #31A9C7; color: #999; ...

2hats Logic HelpBot