Q:

Load page in DIV without redirect

I have small problem with my div's and addresses to load!
I have a link where i call dialog box and load that link address in that dialog box, but when I click on link it opens the dialog box and start to redirect an everything is gone!
Here's how look the address link:
<a href="http://localhost:9090/info.aspx?ID=1341" class="clinfo">INFO</a>

and dialog call:
        $(".clinfo").click(function () {
        $("body").on("click", ".ui-widget-overlay", function () {
            $('#divInfo').dialog("close");
        });
        $("#divInfo").dialog("open");
        $('#divInfo').empty();
        $("#divInfo").load($(this).attr("href"));
    });

I cant figure out where is the problem, because when I call divInfo from iFrame it works like a charm loads page in divInfo perfect. But outside iFrame it opens divInfo an then redirects whole page!

A:

Try using event.preventDefault() as 
 $(".clinfo").click(function (event) {
    event.preventDefault();
    $("body").on("click", ".ui-widget-overlay", function () {
        $('#divInfo').dialog("close");
    });
    $("#divInfo").dialog("open");
    $('#divInfo').empty();
    $("#divInfo").load($(this).attr("href"));
});

