in below code; it gets a content of a “div” includes html codes, and it saves at ajsave.php. But when div html contents include “#” character, data is shorted after “#” like this:
$.ajax({
type: "GET",
url: "ajsave.php",
data: "usr="+id+"&divcontent="+cont,
success: function(msg){
$("#result").html(msg);
}});
In a URL the
#character is used to designate an anchor – part of the page that you want to move the page to – so is ignored by your web server. In order to fix this, you’ll need to escape it on the client-side (in your JavaScript code) using theencodeURIComponent()function, and then unescape it on the server.