Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-Beta2
-
Fix Version/s: 2.0.0
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ACE
Description
The ACE components use JSON escaping to pass parameters from the server to the client, specifically the JSProps and JSFProps parameters. The string escaping adds quotes, and escapes quotes, but also escapes backslashes and forward slashes. In the browser, the escape sequence for the forward slashes remains, as evidenced by inspecting the thumbUrl property on sliderEntry. We need to do some escaping, so that javascript values can exist within an html tag's attribute value.
The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.
The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.
var JSON = YAHOO.lang.JSON,
var jsonStr = JSON.stringify(jsProps, ["selectedDate"]);
console.log(jsonStr);
var selectedDate = JSON.parse(jsonStr).selectedDate;
console.log(selectedDate);
See screenshots 1 and 2 for the input and output.
To process all values, leave out 2nd param. in stringify().
To process multiple specific values, add key names to the 2nd param. (array of key names) in stringify().
(But date time entry works fine even without going through all these.)