kokjj87
09-24-2008, 03:33 PM
Hi, i am new to the prototype framework.. currently still learning on it... I have try to create a chat script.. but it seems like some of the character would not be passable to the php page via ajax..
function addmessage(event)
{
var username = $F('name');
var message = $F('message');
var url = 'cbox.php';
var pars = 'username=' + username + '&message=' + message;
var myAjax = new Ajax.Request(
url,
{
method: 'post',
parameters: pars,
onComplete: addcomplete
});
event.preventDefault();
}
Characters like #?%& are not able to be pass to the next page..
Do i need to do some sort of encoding?.. so that the variable in the paramater would not conflict?
thanks
function addmessage(event)
{
var username = $F('name');
var message = $F('message');
var url = 'cbox.php';
var pars = 'username=' + username + '&message=' + message;
var myAjax = new Ajax.Request(
url,
{
method: 'post',
parameters: pars,
onComplete: addcomplete
});
event.preventDefault();
}
Characters like #?%& are not able to be pass to the next page..
Do i need to do some sort of encoding?.. so that the variable in the paramater would not conflict?
thanks