Troy Bryant
Troy Bryant

Reputation: 1024

Opening jquery dialog

I have a jquery dialog box that i'm trying to open on the click of a hyper link. I'm just writing some generic stuff but not functioning as I expect. When I click the link the dialog opens but has the whole page rather than my selection. The end goal is to make the dialog dynamic based on each link but I'm not seeing my initial error.

New to ajax and each time I have to use it always have issues.

Thanks

<div>
<a href="#" id="tester" onclick="openBox(); return false;"> Open the box</a>

    function openBox(url) {
    var tag = $("<div> Stuff here </div>");
    $.ajax({
        url: url,
        success: function (data) {
            tag.html(data).dialog({ modal: true }).dialog("open");
        }
    });
}//ends open box

Upvotes: 0

Views: 66

Answers (1)

wmfrancia
wmfrancia

Reputation: 1246

You have to pass the URL value to the function

it should be

onCLick="openBox("somevalue");

Upvotes: 1

Related Questions