I am using jQuery to post data from TinyMCE Rich text editor to asp.net backend, but the problem is, i call jquery function, it gives me errors, as the Editor code is in html having double quote, single quote and other html elements which collide with javascript string which is being posted to backend asp.net using .ajax function, so is there anyway encode a javascript string?
Like base64_encode, serialization,
if a code is like <label name="test">Hello</label>, its quotes mixed with js string, and jquery denies to send it, but if we convert it into some encoded string like yHuIolJak90@, it can be sent to backend easily.
Please help.
Thanks
Atif
An easy solution is, as you say, encoding into base 64 so that you don’t have any encoding issues.
On the client side (JavaScript), you can use a small library:
http://www.webtoolkit.info/javascript-base64.html
On the server side (PHP), there is a built-in function:
http://php.net/manual/en/function.base64-decode.php
In fact you don’t even need jQuery for the base 64 JavaScript library.