[問題] 關於jquery ui dialog傳值
想問一下如果我在某一個page "A.html" 寫了一個button 如下面的code
點了之後可以跳出一個jquery的ui dialog...而這個dialog裡面的內容為B.html
如果我想在使用者填完資料後按下dialog的ok button之後,
可以得到在"B.html"裡面id為inputName的值,請問該怎麼取?
(sorry,剛接觸jquery,問題可能很笨,
但我試了很多方法不是取不到值就是undefined)
A.html
----
$(function(){
$('#name').click(function(){
var aaa = window.parent.$.dialog({
buttons: {
'ok': function(){
//取B.html的值(如id為inputName的值)
aaa.dialog('close'); }
}
});
var link = 'B.html';
aaa.load(link);
aaa.dialog('open')
});
});
<div>
<input type="button" value="input your name" id='name'>
</div>
----
B.html
----
<input type="text" name="inputName" id="inputName"/>
----
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.220.253
※ 編輯: heymuheymu 來自: 122.116.220.253 (10/16 19:53)
→
10/16 21:14, , 1F
10/16 21:14, 1F
→
10/16 21:24, , 2F
10/16 21:24, 2F
推
10/17 11:14, , 3F
10/17 11:14, 3F
→
10/17 11:14, , 4F
10/17 11:14, 4F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章
6
12
-16
33