I am stuck with the problem at java script side
1)
var text='{"type": "comTocomp","data":[{ "1" : "Key Parameters" , "2" : "Steel - Sponge/ Pig Iron"},
{ "1" : "No of Companies" , "2" : "6,6 % " }]}';
This is my var text i want to send it server side for generating the excel sheet and also the browser should prompt with popup as to save the file for this i am doing
2)
var url="/XXX/YYYY/genrateSheet"; // URL OF CONTROLLER
var encode=url+ "?data="+text; // URL + PARAMETER+ TEXT CONTENT
var resUri=encodeURIComponent(encode); // TRIED TO ENCODE BUT DOESN'T WORK
**window.location.replace(resUri);** // CALLING TO CONTROLLER TO PROMPT POPUP
The problem is as in var text if it content some special character like % , . the browser shows
The character encoding of the plain text document was not declared
But none of the special character then works fine for me.
I have Google a lot but want to encode the url with the use window.location.replace(resUri)
any help would be help me a lot.
Thanks in Advance