$('.go-back').on('click', function() {
    var referer = '{{referer|escapejs}}';
    var str = location.protocol + '//' + location.host;
    if (referer.indexOf(str) == 0) { // check referer
        location.href = referer;
    }
    return false;
});
