CodeIgniter Forums

Full Version: Problem with posting data ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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);

El Forum

[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)

El Forum

[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

El Forum

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