XMLHttpRequest POST multipart/form-data

后端 未结 7 1533
清酒与你
清酒与你 2020-12-04 20:33

I want to use XMLHttpRequest in JavaScript to POST a form that includes a file type input element so that I can avoid page refresh and get useful XML back.

I can sub

相关标签:
7条回答
  • 2020-12-04 20:58

    I don't see why iframe (an invisible one) implies XHTML and not ANY content. If you use an iframe you can set the onreadystatechange event and wait for 'complete'. Next you could use frame.window.document.innerHTML (please someone correct me) to get the string result.

    var lFrame = document.getElementById('myframe');
    lFrame.onreadystatechange = function()
    {
       if (lFrame.readyState == 'complete')
       {
          // your frame is done, get the content...
       }
    };
    
    0 讨论(0)
提交回复
热议问题