Sunday, July 12, 2015
Thursday, January 15, 2015
submit a file or form with iframe in javascript
$('#ad6 #uploaddatabtn').click(function(){ console.dir('------EthanYen M9505506@gmail.com------') var iframe = $(''); $("body").append(iframe); var form = $('#formSend2'); form.attr("action", "./api/contentInput2.php"); form.attr("method", "POST"); form.attr("encoding", "multipart/form-data"); form.attr("enctype", "multipart/form-data"); form.attr("target", "tempIframe"); //form.attr("file", $('#userfile').val()); form.submit(); $("#tempIframe").load(function () { iframeContents = this.contentWindow.document.body.innerHTML; console.dir(iframeContents) $(iframe).remove() $("#textarea").html(iframeContents); }); //return false; })
Subscribe to:
Posts (Atom)