1
0
-1

Hello,

I need to return a base64 string to place in an image's src as returned from dynamic data (to generate a CAPTCHA). To test, I'm trying to save the string in a data field which would then be used to update the src of the image in question via Jquery.  Here's an example of the data field storing the string:

var string = "data:image/gif;base64,R0lGODlhLAE8APcAAAAAAAAAMwAAZgAAmQAA//more";
return string;

The issue is, everything after the double forward slash is cut off and the string isn't closed, resulting in an error.

(note, that's not limited just to encoded image strings - "test//test" results in the same issue)

Any suggestions appreciated.  Thanks!

    CommentAdd your comment...

    1 answer

    1.  
      3
      2
      1

      Hi Sam,

      As a quick test, what happens if you replace all '//' occurrences in your base64 strings with the Unicode equivalent \u002f\u002f ?

      1. Sam Fursdon

        That's done it thanks Bill! I'll make sure the dynamic data service does that replacement before it reaches the form. 

      CommentAdd your comment...