该计划是在输入字段后面添加JSON数据,而不是在里面。 目前我使用:追加输入字段
var $input = $("<input/>"),
$input.attr('type', 'checkbox');
$input.attr('name', 'formats[]');
$input.attr('value', 'bzz');
$input.html(jsonData['title']);
$("#target").append($input);
而且它产生:
<input type="checkbox" name="formats[]" value="bzz">Data shows here</input>
我不确定你在这里试图完成什么。你能否给出一个解释你为什么试图在输入元素中添加JSON数据? –
我在添加新复选框到我的表单后,Ajax提交新的数据。 – slc
你能表演吗?什么是预期产出? – Satpal