我正在使用.each函数来抓取div,但我无法将ID传递给我的模式框函数。这里是代码:传递ID属性
(function() {
$('div.heriyah').each(function() {
$(this).html('<div class="add"><div id="add_button_container"><div id="add_button" class="edit_links">+ ADD NEW CONTENT</div></div></div><div class="clear"></div><div class="placeable"></div></div>');
$('.add').click(function() {
$.fallr('show', {
content : '<iframe width="620" height="600" src="<? echo $URL ?>/manage_content.php?id=<? echo $pageID; ?>&div='+$(this).attr('id')+'"></iframe>',
width : 620 + 5, // 100 = for width padding
height : 600,
closeKey : true,
closeOverlay : true,
buttons : {}
});
});
});
})();
我得到Undefined
如果我请求我的模态框中的变量。
我用这个:
'+$(this).attr('id')+'
抢我的模式对话框函数内部的ID。
感谢, 鼓手
谢谢,这使得这么多的意义。我今天学了些新东西! – drummer392