0
사용자가 iframe에서 입력 한 양식 데이터를 읽으려면 어떻게해야합니까? JQuery와를iframe에서 양식 데이터 읽기
<table id="form-table">
<td><input type="checkbox" name="n_available" checked="checked"></td>
<td><input type="checkbox" name="n_oem" checked="checked"></td>
</table>
과 전화 :
JQuery와 :
function getRowData(id, parent){
var data = [];
$(parent+' table tr').each(function(){
var row = {};
$(this).find('select, input, textarea').each(function(){
if(($(this).attr('id') == id) && (typeof $(this).attr('name') !== 'undefined' && $(this).attr('name') !== false)){
row['id'] = id;
row[$(this).attr('name')] = $(this).val();
}
});
data.push(row);
});
return data;
}
및 HTML iframe이없는
, 내가 이런 일을 할 것$('.get-data').live('click', function() {
postData = $(this).attr("id");
getRowData("form-table", $(this).attr("id");//here i have my form in an array...
});
지금 html 인 경우 iframe에서 데이터를 얻으려면 어떻게해야합니까?
'iframe'페이지가 동일한 도메인에서 제공됩니까? – Chris
예 동일한 도메인에서 온 것입니다. – tom91136