谁能告诉我我在以下代码中做错了什么,表单没有提交到 iframe?
$(function() {
$(".preview").click(function() {
$('#sliderimage').wrap('<form action="/index/upload.php" method="post" id="imageform" target="imageupload" />');
$('#imageform').submit();
$('#sliderimage').unwrap();
return false;
});
});
<iframe style="display: none;" name="imageupload" id="imageupload"></iframe>
<input type="file" id="sliderimage" name="sliderimage">
<input type="button" class="preview" value="Preview">