This is the anchor that MVC 2 is creating:
<a class="syncLink" data-resultstarget="OmsToAdminPzInfoSyncResult"
href="/Sync/OmsToAdminPzInfoAjax"
onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: 'OmsToAdminPzInfoSyncResult' });">
Pz Info</a>
And here’s some jQuery. The first alert shows what it should, but the second shows undefied. I’m using jQuery 1.4.1
$("a.syncLink").click(function () {
alert($(this).attr("data-resultstarget"));
alert($(this).data("resultstarget"));
});
I know I asked this question before, but I don’t have any camel casing here, so I’m not sure what the issue is.
This feature was added in jQuery 1.4.3.
You need to upgrade jQuery.
In older versions, you’ll need to use
.attr("data-resultstarget")