var redaction = "NO"; if(redaction == 'YES'){ $(window).load(function(){ $('#myModal2').modal('show'); });}