This is a known issue in Sitecore 8 (as of Update-6) and Sitecore 8.1 (initial release). Making changes and clicking save will result in an error on the page:
and an error in the log:
54740 09:13:53 ERROR Bad JSON escape sequence: \a. Path 'r.d.r[22].rls.ruleset.rule[0].conditions.condition.@value', line 156, position 44.
54740 09:13:53 ERROR Bad JSON escape sequence: \a. Path 'r.d.r[22].rls.ruleset.rule[0].conditions.condition.@value', line 156, position 44.
This has to do with using rules which contain a "" character in a condition's value.
Here is the workaround from Sitecore:
Open the \Website\sitecore\shell\client\Sitecore\ExperienceEditor\Commands\Save.js
\Website\sitecore\shell\client\Sitecore\ExperienceEditor\Commands\Save.js
file.Replace the following line in the execute: function (context) function: context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value); with
function (context) function: context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value);
with this line: context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\/g, '\\'));
context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\\/g, '\\\\'));
For 8.1, the fix is slightly different, replacing: context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value); with
context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value);
with this line: context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\/g, '\\'));
context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\\/g, '\\\\'));
Save these changes and close the file.
Clear your browser cache.
To track the future status of this Sitecore bug, please use the reference number 55394. More information about Sitecore public reference numbers can be found here.