-
28 Oct 2009 1:05 AM #1
Problem in IE
Problem in IE
I have small window, in that I have one Textarea field and OK button for saving that data,
now when i am typing something in textarea by pressing "Enter" key i will go to next line after i will type something(now entier data in two lines). In textarea value i am retriving by getvalue from json data and i am converting \n by using this code in Firefox it is working means saving but in IE it is not saving and showing error "unterminated string constant "
please check the code
jsonData1 = jsonData1.substring(0, jsonData1.length-1);
jsonData1 = jsonData1.replace(/\n/g,'');
jsonData1="{"+jsonData1+"}";
Please give some suggestions for resolving this issues
Thanks.
-
28 Oct 2009 2:39 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
1. This is not a bug in Ext, so I'm going to move this to the Help section.
2. The fragment you posted can't generate an 'unterminated string constant' error. Post all your code for getting and saving the textarea value.
-
29 Oct 2009 2:31 AM #3
-
29 Oct 2009 2:57 AM #4
-
2 Nov 2009 9:03 PM #5
-
2 Nov 2009 11:28 PM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Did you actually read my reply?
The fragment you posted can't generate an 'unterminated string constant' error.
Post all your code for getting and saving the textarea value.
-
3 Nov 2009 1:39 PM #7Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
3 Nov 2009 8:41 PM #8
Thanks for giving response.
Major problem is I want to replace Enter ASCI character with space,
Where in mozilla i am getting Enter ASCI character as "\n" here i am replacing "\n" with space,
But in IE Enter ASCI character is not getting as "\n", so i can’t able to replace Enter ASCI character.
Will you please give me the details bout the ASCI character for "Enter " in IE ?
If i can able to replace Enter Character my problem will solves.
-
4 Nov 2009 12:05 AM #9Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
That is because in IE an enter is a CR+LF, but in other browsers it's only a LF.
You should use:
(but what does this have to do with an 'unterminated string constant'?)Code:jsonData1 = jsonData1.replace(/\r?\n/g, ' ');
-
4 Nov 2009 1:31 AM #10
OOOOOOh it’s working.

My problem was solved
Thanks lot
,


Reply With Quote