Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open xml content in new window with save or download option using mvc ajax javascript.

Below is the code i have tried..But it displays the content in new window without xml format.I am generating the xml string using serialization

What I have tried:

$.ajax({
              url: 'CreateXML',
              type: 'POST',
              data: JSON.stringify(params),
              contentType: 'application/json; charset=utf-8',
              dataType: "json",
              async: false,
              cache: false,

              success: function (msg) {
                  var newWindow = window.open("","new");
                  newWindow.document.open("text/xml");
                  newWindow.document.write(msg.xmlText);

//var w = window.open();
                   //$(w.document.body).html(msg);</p
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900