hi pal
im back again,
and i think im on to something!
check this. :)
well let me know what u think
peace
im back again,
and i think im on to something!
check this. :)
Code:
<html> <!-- Created on: 14-4-2007 --> <head> <title></title> <script language="JavaScript1.2"> //array of non allowed characters NotAllowed = new Array(); NotAllowed[0]='@'; NotAllowed[1]='!'; NotAllowed[2]='"'; NotAllowed[3]='$'; NotAllowed[4]='%'; NotAllowed[5]='&'; NotAllowed[6]='_'; NotAllowed[7]='('; NotAllowed[8]=')'; NotAllowed[9]='\''; NotAllowed[10]='?'; NotAllowed[11]='/'; NotAllowed[12]='\\'; NotAllowed[13]='~'; NotAllowed[14]='°'; NotAllowed[15]='¸'; NotAllowed[16]='}'; NotAllowed[17]='{'; NotAllowed[18]='£'; NotAllowed[19]='¾'; NotAllowed[20]='½'; NotAllowed[21]='¼'; NotAllowed[22]='¬'; NotAllowed[23]='§'; NotAllowed[24]='|'; NotAllowed[25]='¨'; NotAllowed[26]='*'; NotAllowed[27]='<'; NotAllowed[28]='>'; NotAllowed[29]='`'; NotAllowed[30]='´'; NotAllowed[31]='±'; NotAllowed[32]='='; NotAllowed[33]='-'; NotAllowed[34]='.'; NotAllowed[35]=';'; NotAllowed[36]=':'; NotAllowed[37]=','; NotAllowed[38]='.'; NotAllowed[39]='»'; NotAllowed[40]='µ'; NotAllowed[41]='¦'; NotAllowed[42]='['; NotAllowed[43]=']'; NotAllowed[44]='#'; NotAllowed[45]=' '; var i = 0; function displaynames(){ heading=document.getElementById('mydiv');//the display div names='111###22"2###3#33###44"4###55$5###6%66###7&77###8_88###9(99###101 010';//the string nextname = names.split("###");//split names for (XxX=0;XxX<NotAllowed.length;++XxX){ teststring=nextname[i].indexOf(NotAllowed[XxX])+1;//compare string for illegal charaters by looping through array if(teststring!='0'){//if an illegal charater has been found firstpart=nextname[i].substring(0,teststring-1);//get the first piece of string before illegal character secondpart=nextname[i].substring(teststring,nextname[i].length);//get the last piece of the string behind the illegal character nextname[i]=firstpart+secondpart;//rejoin them } else{ } } if (nextname[i]==null){ heading.innerHTML = 'finished'; return false; }else{ heading.innerHTML = nextname[i]; i++; setTimeout('displaynames()',2000); } } </script> </head> <body onload="displaynames()"> <div id="mydiv"></div> </body> </html>
peace
Comment