Results 1 to 3 of 3

Thread: isformpost + isupload response back-slash question

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    26
    Vote Rating
    0
      0  

    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>
    &quot; 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 "&quot; must be back-slashed because the textarea will convert them to actual quotes" which makes sense (i.e. &quot; 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 &quot; 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
    Attached Images Attached Images

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    Mark -

    The issue is because the following HTML:
    Code:
    <textarea>
    &quot;
    </textarea>
    Will be interpreted by the browser as:
    Code:
    <textarea>
    "
    </textarea>
    Therefore executing some code like:
    Code:
                    $json = preg_replace("/&quot;/", '\\&quot;', $json);
    will escape the quotes generating:

    Code:
    <textarea>
    \&quot;
    </textarea>
    Aaron Conran
    @aconran

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    26
    Vote Rating
    0
      0  

    Default

    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

  1. Replies: 12
    Last Post: 14 Sep 2010, 6:06 AM
  2. Show the response back in the edited row
    By Pachat in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 19 Jan 2010, 5:39 AM
  3. Replies: 4
    Last Post: 14 Oct 2008, 11:27 PM
  4. HOWTO: grab back response from treeloader
    By jumpo in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 20 Aug 2007, 9:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •