why dojo removes \n and \t from url text?

Hi, I am sending some text through dojo but when i receive that text at server it gives me text without \n and \t.Kindly help me.
[150 byte] By [rohit_dixita] at [2007-11-27 0:14:13]
# 1

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".

knightweba at 2007-7-11 21:59:08 > top of Java-index,Java Essentials,Java Programming...
# 2

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.

rohit_dixita at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...
# 3
Does escaping the text make any difference? I'm assuming your Ajax request is going from client browser to web server. If its going from web server to client browser then there are methods to escape text Strings in Java too.
knightweba at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...
# 4
Actually I have to copy paste some data from xml file to Textarea then I have to make an Ajax request after that I need to show xl data into tabular format. Thatswhy I require \t and \n.
rohit_dixita at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...
# 5
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.But maybe this is a Javascript question that somehow got posted in this forum?
DrClapa at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...
# 6

> 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.

knightweba at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...
# 7

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.

rohit_dixita at 2007-7-11 21:59:09 > top of Java-index,Java Essentials,Java Programming...