如何获得通行证id
的价值button
,以jquery dialog
按钮点击。我不想使用传递值query string
。是否有任何方法可以使用的属性或属性直接传递值jquery dialog
。
看法:
<input type="button" value="Create New" class="Create" id="1"/>
jQuery:
$(".Create").on("click", function (e) {
var Id=$(this).atrr('id');
$('#Load').empty();
//overflow: visible !important;
e.preventDefault();
$('#Load').dialog({
autoOpen: true,
modal: true,
draggable: true,
resizable: false,
height: 500,
width: 600,
position: { my: "center", at: "center", of: window },
dialogClass: 'fixed-dialog',
title: 'Create New Word',
open: function (event, ui) {
$(this).load("/Dictionary/_Create");
},
//close: function (event, ui) {
// window.location.href = window.location.href;
//}
});
return false;
});
您可以更改此行
var Id=$(this).atrr('id'); To BTW atrr is suppose to be attr
CurrentId = $(this).attr('id'); without the var
然后在/ Dictionary / _Create页面中,您可以使用javascript简单访问CurrentId变量,因为它是全局变量
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句