javascript - How to append empty string to FormData -


i have ajax script sends formdata object via ajax.

the code looks this:

fd = new formdata(); fd.append('title', $('.some_input').val()); // few other appends including file  jquery.ajax({   url: 'some_url',   datatype: 'json',   processdata: false,   contenttype: false,   data: fd }) 

when $('.some_input').val() not empty, works predicted, server gets necessary param. in case of input value empty string behaves missing append. how can put empty string formdata in case?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -