Welcome Guest, Not a member yet? Register   Sign In
Problem with posting data ...
#1

[eluser]xJoseph10[/eluser]
Hi everybody ,
I'm using codeigniter in my new forum script ,
I have recently a probleme with posting CKeditor data with an Ajax request (POST method)
This is my ajax request
Code:
var nsig = CKEDITOR.instances.signature.getData();
        $("#sigcont").html(progress);
  $.ajax({
     type: "POST",
     url: '<?=$url?>index.php/profil/show/<?=$id?>',
     data: 'sig=edit&new;_sig='+nsig,
     success: function(){
   $("#sigcont").html(nsig);
  }
  });
When i save simple data in CKeditor without caracters its work without any probleme
but when I write caracters like ' Or " the input class returns a NULL value
I'm waiting for your answers
#2

[eluser]xJoseph10[/eluser]
I wanna know if its a great idea to use the funtion escape
before using ajax post
Code:
var text = CKEDITOR.instances.editor1.getData();
var request_text = escape(text);
#3

[eluser]CodeIgniteMe[/eluser]
You can use escape() function to serialize the data and then unserialize it at the back-end.

Code:
' Or " when escape()d by javascript will return "% 27% 20Or% 20% 22" (without quotes and spaces)
#4

[eluser]xJoseph10[/eluser]
[quote author="CodeIgniteMe" date="1332901115"]You can use escape() function to serialize the data and then unserialize it at the back-end.

Code:
' Or " when escape()d by javascript will return "% 27% 20Or% 20% 22" (without quotes and spaces)
[/quote]
Thank u ,
so I'm using escape now , & when I get data from data base i use unescape to decode id ;
its works so cool
#5

[eluser]CodeIgniteMe[/eluser]
Thank you too, I've learned something new to me from you.




Theme © iAndrew 2016 - Forum software by © MyBB