Dojo transmits xml. I'm supprised it sent your text at all, as some AJax methods crash with \n. You need to escape your text before you send it, this might work
var textToSend = escape(text);
I've not used Dojo before but it most likely has built in methods for encoding.....try google "dojo+data+encoding"
Also, if this doesn't help post your code as there could be other problems......for instance if you use a "TEXTAREA" to gather the data its possible its not set to send "\n" and "\t".
earlier I was using protopye framework of Ajax and it was running fine.
Then I switched to dojo framework of Ajax. But now I am getting probelm of removal of newline character and tab character and other special characters.
I have created my own Ajax request but it was also giving the same problem.
> Both newlines and tab characters are valid characters
> in XML so I don't understand any of those
> suggestions. In XML there is no concept of "escaping"
> newlines or tabs.
True. "\n" and "\t" are valid for XML, however Flashes AJAX implementation doesn't support them, so I'm guessing DOJO doesn't either. But you are right, it has nothing to do with XML, just the way AJAX strings are passed between JavaScript and ActiveX or Embedded objects like Flash.
> But maybe this is a Javascript question that somehow
> got posted in this forum?
Yes this is a JavaScript problem. However perhaps not the wrong forum as AJAX also includes server side, which in this case is Java
You problem is most likely to do with "textarea" check out this link :-
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp
You need to set ( wrap="hard" ) otherwise "\n" and "\t" get binned.
Hi,
that error was coming bec i was sending text as url string if we send text like
url: "/Apollo/brkrTextProcess.do",
content: {txtPaste : bulkBrokerText },
load: function(type, data, evt){ showResponse(data); },
error: function(type, data, evt){ reportError(type,data,evt); },
method: "POST",
mimetype: "text/plain"
then it doesn't remove \n, \t and any other special char. And we can send bulk text also.