window.onorientationchange = function(){

    var orientation = window.orientation;

    // Look at the value of window.orientation:

    if (orientation === 0){

        window.location.reload();

    }

    else if (orientation === 90){

        window.location.reload();

    }


    else if (orientation === -90){

        window.location.reload();

    }

    else if (orientation === 180){

        window.location.reload();

    }

    else if (orientation === -180){

        window.location.reload();

    }

}

