Create Globally Unique ID (GUID) in JavaScript

In this blog post I will explain how to create globally-unique identifiers in JavaScript.

This will be a version 4 compliant solution that solves the chance for collision by offsetting the first 13 hex numbers by a hex portion of the timestamp. That way, even if Math.random is on the same seed, both clients would have to generate the GUID at the exact same millisecond (or 10,000+ years later) to get the same GUID:

function generateGuid(){
    var d = new Date().getTime();
    if(window.performance && typeof === "function"){
        d +=;; //use high-precision timer if available
    var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = (d + Math.random()*16)%16 | 0;
        d = Math.floor(d/16);
        return (c=='x' ? r : (r&0x3|0x8)).toString(16);
    return guid;

Hope it may be useful!



SharePoint page state is commonly used to perform specific actions based on the state. For instance, isInEditMode is used to determines whether the page is currently being edited. For more page state methods and their description please visit next MSDN link:

SP.Ribbon.PageState.Handlers Methods

Using next line in JavaScript you will be able to check whether edit state of a SharePoint page:

var inEditmode = SP.Ribbon.PageState.Handlers.isInEditMode();

In this blog post I will explain why this solution sometimes is not working and present the solution.

Continue reading “SP.Ribbon.PageState”

Finding and manipulating SharePoint Controls in Page Layouts


Recently I have been working on a project where we needed to create page layouts in SharePoint. SharePoint provides you the possibility to include page fields into page layouts. A very common way to include these fields  is to use snippets that you could automatically create by using the Snippet Gallery. In this post I will provide some mind-blowing tips and tricks about customization of Page Layouts in SharePoint.

Continue reading “Finding and manipulating SharePoint Controls in Page Layouts”

The Most Popular Frontend Frameworks of 2016 – part 1

Nowadays there are several open source HTML/CSS/JavaScript frameworks available for front-end UI applications.

In this article I will point out some of the most popular ones and try to explain which one of them better worked out for me; considering the installation effort, set of components, extensibility and maintenance. Another important criteria for me and perhaps for many of you is how easy /difficult it is to integrate this framework in a web project.

The frameworks that I’m going to explore are presented randomly, beginning with one of the most popular, which is, of course, Bootstrap.

Continue reading “The Most Popular Frontend Frameworks of 2016 – part 1”

Top JavaScript Frameworks, Libraries and Tools


Angular is the popular enterprise framework that many developers are using to build and maintain complex web applications. Angular’s popularity is immense, and companies using it are as diverse as Domino’s Pizza, Ryanair, iTunes Connect, PayPal Checkout, Google. Angular is an open source framework supported by Google. Angular describes itself as an extension to HTML for building complex web apps. Also if you’re familiar with TypeScript, that’s how Angular 2 was written.

Continue reading “Top JavaScript Frameworks, Libraries and Tools”