Jump to content

in the mootools

xiaofanku's Photo
Posted Dec 10 2009 11:17 PM
4951 Views

a mootools 1.1 ajax request code:
 
         if('identity'){
        	 $('identity').addEvent('change',function(event){
        		 new Event(event).stop();
        		 var requrl=getCurrentAppLocation()+"/chidentity.do";
        		 new Ajax(requrl,{
        			 method:'get',
        			 data:{real:$('real').getValue(),identity:$('identity').getValue()},
                                 update:$('identity'),
        			 onComplete:callbackFun
        		 }).request();
        	 });
         }      


run after,$('identity')="this identity is exist".but i hope it is:"<font color="red">this identity is exist</font>".
callbackFun code:
function callbackFun(response){
    var reStr=response;
    if(response.indexOf(':)')==-1){
         reStr="<font color=\"red\">"+reStr+"</font>";
    }
    return reStr;
}

I'Love O'REILLY Book And something

Tags:
0 Subscribe


1 Reply

 : Dec 10 2009 11:20 PM
In the absence of the response can be inserted into the element before the change in the incident response string
I'Love O'REILLY Book And something