Calling a function on click of OK button in a pop up in the Javascript
<p>I have a function in Javascript that displays a pop-up. I am doing this in a Sitecore based MVC project and hence I can not do the events in the normal way but following the practice that is followed in project.</p>

<pre><code>if (isWarning) {
        $('#warning').modal('show');
        $("#WarningDisplay").val("true");
    }
</code></pre>

<p>Now the modal is shown without any problem and the modal has a OK button only (Only one button). Clicking on OK should call this function below. </p>

<pre><code>function DialogOkClick() {
    $('#warning').modal('close');
    $('#CalButton').click();
}
</code></pre>

<p>Basically, what I intend to do in this function is, close the pop up and trigger the click even of home page.</p>

<p>How to call this function on click of OK in the pop up which is displayed as a result of first function? Its a modal pop up.</p>

<p>EDIT:</p>

<p>We use InfoDialogViewModel in the cshtml file for defining the warning dialog and its contents. </p>