Javascript


Reload current page from Javascript

This code will make the browser reload your current page.

window.location.assign(window.location.href);

 

Random GUID

function NewGuid(){
    var d = new Date().getTime();

    var uuid = 'xxxxxxxx-xxxx-xxxx-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 uuid;
}

 


Published: 2016-08-22