POST a form with Jquery AJAX When input is a File

后端 未结 2 877
你的背包
你的背包 2021-02-09 06:21

I have several areas where I use AJAX to submit text fields.

 var name = $(\"input#name\").val(); 

   $.ajax({  
      type: \"POST\",  
      url: \"bin/proces         


        
2条回答
  •  不思量自难忘°
    2021-02-09 06:50

    This is typically done using an iFrame to send the file to the server.

    The jQuery Form Plugin is a great resource for that.

    Here is another upload script which uses xhr when possible (FF, Safari) and falls back gracefully to iFrame if necessary (IE)

提交回复
热议问题