• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problems with ajax

I got a problem similar to this.
I have a textarea and a button that sends me to a javascript function.
The function gets the value of the textarea and codes it so not to mess up my url and then by prototype I go to my controller.

My javascript function :

function enregEx(index,params){
  var param = document.getElementById('excuseTxt'+index).value;
// alert(encodeURIComponent(param));
    var url='enregExcuse/'+params+'/'+encodeURIComponent(param);  
    new Ajax.Updater('excuseDiv'+index,url,{onLoading:function(request){cursor_wait();}, onComplete:function(request){cursor_clear();}, evalScripts:true}); return false;

I've tried escape() , encodeURI() and the method encodeURIComponent() but get that my request contains illegal characters all the time.

Any ideas ?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.