jQuery iframe file upload
<p>Im building a file upload with jQuery, but Im getting a jQuery error trying to set the attributes of the form:</p>

<pre><code>$(document).ready(function () {
            $("#formsubmit").click(function () {

                var iframe = $('&lt;iframe name="postframe" id="postframe" class="hidden" src="about:none" /&gt;');

                $('div#iframe').append(iframe);

                $('#theuploadform').attr("action", "/ajax/user.asmx/Upload")
                $('#theuploadform').attr("method", "post")
                $('#theuploadform').attr("userfile", $('#userfile').val())
                $('#theuploadform').attr("enctype", "multipart/form-data")
                $('#theuploadform').attr("encoding", "multipart/form-data")
                $('#theuploadform').attr("target", "postframe")
                $('#theuploadform').submit();
                //need to get contents of the iframe
                $("#postframe").load(
            function () {
                iframeContents = $("iframe")[0].contentDocument.body.innerHTML;
                $("div#textarea").html(iframeContents);
            }
        );



&lt;div id="uploadform"&gt;
    &lt;form id="theuploadform" action=""&gt;
        &lt;input id="userfile" name="userfile" size="50" type="file" /&gt;
        &lt;input id="formsubmit" type="submit" value="Send File" /&gt;
    &lt;/form&gt;
&lt;/div&gt;

&lt;div id="iframe" style="width: 0px; height: 0px; display: none;"&gt;
&lt;/div&gt;

&lt;div id="textarea"&gt;
&lt;/div&gt;
</code></pre>
