-
20 Jun 2010 8:06 PM #1
isformpost + isupload response back-slash question
isformpost + isupload response back-slash question
Hello,
I'm working through the Ext.Direct spec to develop an Ext.Direct router and have a question about the isformpost + isupload response paragraph...
<html><body><textarea>{YOUR JSON RESPONSE HERE}</textarea></body></html>
" must be back-slashed because the textarea will convert them to actual quotes. Therefore you must do a regular expression (/"/, "\"")
In my browser I see "" must be back-slashed because the textarea will convert them to actual quotes" which makes sense (i.e. " will become "). It's the next sentence "Therefore you must do a regular expression (/"/, "\"")" which has me confused. I don't see how that regular expression will do anything to address the " issue.
Maybe it's just a browser character encoding/decoding/display issue. I have attached a screen shot in case the original text is lost in the post.
Thanks,
Mark
-
28 Jun 2010 9:54 AM #2
Mark -
The issue is because the following HTML:
Will be interpreted by the browser as:Code:<textarea> " </textarea>
Therefore executing some code like:Code:<textarea> " </textarea>
will escape the quotes generating:Code:$json = preg_replace("/"/", '\\"', $json);
Code:<textarea> \" </textarea>
Aaron Conran
@aconran
Sencha Architect Development Team
-
28 Jun 2010 5:31 PM #3
Thanks for your response Aaron! That clears it up for me...
Actually when looking at the spec source the meaning is clear (I only just did that now) so it's a problem with browser rendering which should probably be fixed.
Cheers,
Mark
Similar Threads
-
[CLOSED][3.0.3] Response returned from a submit using isUpload, lost the content type
By dtex-lab in forum Ext 3.x: BugsReplies: 12Last Post: 14 Sep 2010, 6:06 AM -
Show the response back in the edited row
By Pachat in forum Ext 3.x: Help & DiscussionReplies: 6Last Post: 19 Jan 2010, 5:39 AM -
[2.2] Response is not getting back while using file upload extensions
By savvion in forum Ext 2.x: BugsReplies: 4Last Post: 14 Oct 2008, 11:27 PM -
HOWTO: grab back response from treeloader
By jumpo in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 20 Aug 2007, 9:48 PM


Reply With Quote