-
11 May 2012 6:07 AM #1
Unanswered: Including double quotes and some text bold and in color in my returned jsonp data
Unanswered: Including double quotes and some text bold and in color in my returned jsonp data
Hello,
If I have double quotes and any text bold and in color returned from my jsonp data, I get Uncaught SyntaxError: Unexpected identifier I have found that this is an issue with special characters. How do you go about allowing what I am trying to do? I see double quotes in the data returned for the Watch List app, so I at least should be able to do that.
Thanks,
Paul
-
14 May 2012 11:35 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
valid json (the bit inside the callback function of jsonp) needs to have the property and value surrounded in double quotes. If you are going to have double quotes within the value then you need to escape it or replace with ascii
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
15 May 2012 5:32 AM #3
Thanks Mitchell,
What about <span></span> or other tags? Is there not a way to do this. I would want to do this to make certain words bold and in a different color.
Thanks,
Paul
-
15 May 2012 6:38 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
response:Code:Ext.data.JsonP.request({ url : 'data/php.php', success : function(data) { console.log(data); } });
That worked. Also tried this response:Code:Ext.data.JsonP.callback1({ "data": "<span class='test'>Test</span>" });
Code:Ext.data.JsonP.callback1({ "data": "<span class=\"test\">Test</span>" });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 May 2012 6:06 AM #5
I have played around with this more, and for me any <spans>, <divs>, or any other tags, are ignored. So I cannot find a way to have any words bold or color. Is there a possible solution to this? Thanks!


Reply With Quote