How to dynamically create a xml file and set it to the upload control using javascript or jquery -


i want dynamically create xml file using jquery or javascript , don't want download it. want assign upload control. on button click want send controller. how can able using jquery. appreciated.

you can't send xml file generated js in client side because have not file string. can send string server using jquery post function (http://api.jquery.com/jquery.post/). create valid xml string:

var xml = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\" ?>" + "<root>" + getxml() + "</root>" 

and send server:

$.post('test.html',{ data : xml }, function(data) {     $('.result').html(data); }); 

hope helps ;)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -