Clone an object in javascript with prototype chain intact

Many times you’d need to clone an object in JavaScript. It can be achieved in many ways. However, the prototype chain is lost in many of the mechanisms. In case you are looking for a shallow cloning, which retains the prototype chain, without using a library like lodash, angular or jQuery, here is the way.

Continue reading Clone an object in javascript with prototype chain intact

Console API you may not have known

Javascript console API may be a non standard API, however, it is indispensable for a web developer. You might have restricted yourself to console.log, which, for most of the times, is the only function we might want. But it could result in a bulky and messily logged screen. Console object has lots of additional useful methods, which could boost your debugging.

Continue reading Console API you may not have known

Project: Discussion extractor from JIVE using v3 API

Jive discussion extractor
Jive discussion extractor

I recently did a small project on Jive API, which extracts discussions marked as questions from a Jive place and downloads to user’s machine as an excel file. This has been particularly useful for people, who track questions they have posted and can filter the results on excel.

Continue reading Project: Discussion extractor from JIVE using v3 API

Cross domain communication using postMessage and local storage

There could be scenarios like having an iFrame from sister application, which is hosted on a different domain within a host application. If data needs to be passed between these applications and server side way is ruled out, then here’s a safe way to do so entirely on client side.

Continue reading Cross domain communication using postMessage and local storage