Make replace work for two or more occurrences.

This commit is contained in:
Mattias Põldaru 2011-12-23 17:47:36 +02:00
parent e94ab832eb
commit 514773abe8

View File

@ -209,7 +209,7 @@ window.OpenLP = {
showAlert: function (event) {
event.preventDefault();
var text = "{\"request\": {\"text\": \"" +
$("#alert-text").val().replace("\\", "\\\\").replace("\"", "\\\"") +
$("#alert-text").val().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") +
"\"}}";
$.getJSON(
"/api/alert",