Hi!
I am using editArea for a project of mine. And I am using two buttons to save the content of the editArea. One "Save" (which will go directly through form, to php, and then be redirected to another page). And one "Apply" which will save using an AJAX function, like this :
And the "Save" button that will save the data using form -> php works perfectly. But when I press the "Apply" (AJAX function) it will loose characters like \ / + && and similar.Code:function saveContent() { var table = "<?php echo $table; ?>"; var type = "<?php echo $type; ?>"; var id = "<?php echo $id; ?>"; var name = "<?php echo $name; ?>"; var parameters = "contents=" + editAreaLoader.getValue("editArea1"); parameters = parameters + "&table=" + table; parameters = parameters + "&type=" + type; parameters = parameters + "&id=" + id; parameters = parameters + "&name=" + name; var xmlHttpReq = null; // Mozilla/Safari if (window.XMLHttpRequest) { xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } xmlHttpReq.open('POST', 'save.php?ajax&edit'); xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.setRequestHeader("Content-length", parameters.length); xmlHttpReq.setRequestHeader("Connection", "close"); xmlHttpReq.onreadystatechange = function() { if (xmlHttpReq.readyState == 4) { alert("Saved!"); } }; xmlHttpReq.send(parameters); }
So the code
will becomeCode:if(somebool && anotherbool) function();
Which clearly will not work...Code:if(somebool anotherbool) function();
What can I do to make it work properly?
Thanks,
Artheus


Reply With Quote

Bookmarks