Sending html data via $post fails
        Posted  
        
            by Neil
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Neil
        
        
        
        Published on 2010-03-22T01:14:44Z
        Indexed on 
            2010/03/22
            1:21 UTC
        
        
        Read the original article
        Hit count: 368
        
I am using the code below which is fine but when I use the code below that in an attempt to send an html fragment to a processing page to save it as a file but I get nothing.
I have tried using ajax with processData set to false ads dataTypes of html, text and xml but nothing works. I can't find anything on this so I guess I must be missing something fairly trivial but I've been at it for 3 hours now.
This works
$.post("SaveFile.aspx", {f: "test4.htm", c: "This is a test"},
   function(data){
        alert(data);
   }, "text");  
This fails
$.post("SaveFile.aspx", {f: "test4.htm", c: "<h1>This is a test</h1>"},
   function(data){
        alert(data);
   }, "text");  
© Stack Overflow or respective owner