• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Share Code viết chử ngược

tubotocdo

Active Member
Demo: TEST

tuoitreit.vn.jpg


code css:
HTML:
<STYLE type=text/css>TEXTAREA {
    FONT-FAMILY: "Arial Unicode MS", Batang
}
H1 {
    MARGIN-BOTTOM: 2px
}
</STYLE>
Code javascript:
HTML:
<SCRIPT>
function flip() {
 var result = flipString(document.f.original.value.toLowerCase());
 document.f.flipped.value = result;
}

function flipString(aString) {
 var last = aString.length - 1;
 //Thanks to Brook Monroe for the suggestion to use Array.join
 var result = new Array(aString.length)
 for (var i = last; i >= 0; --i) {
  var c = aString.charAt(i)
  var r = flipTable[c]
  result[last - i] = r ? r : c
 }
 return result.join('')
}

var flipTable = {
a : '\u0250',
b : 'q',
c : '\u0254', //open o -- from pne
d : 'p',
e : '\u01DD',
f : '\u025F', //from pne
g : '\u0183',
h : '\u0265',
i : '\u0131', //from pne
j : '\u027E',
k : '\u029E',
//l : '\u0283',
m : '\u026F',
n : 'u',
r : '\u0279',
t : '\u0287',
v : '\u028C',
w : '\u028D',
y : '\u028E',
'.' : '\u02D9',
'[' : ']',
'(' : ')',
'{' : '}',
'?' : '\u00BF', //from pne
'!' : '\u00A1',
"\'" : ',',
'<' : '>',
'_' : '\u203E',
'\u203F' : '\u2040',
'\u2045' : '\u2046',
'\u2234' : '\u2235',
'\r' : '\n' //thank you, Yeeliberto
}

for (i in flipTable) {
  flipTable[flipTable[i]] = i
}
</SCRIPT>
Code html:
HTML:
<b>TẠO CHỬ NGƯỢC</b>

<FORM name=f>Nhập văn bản: <BR><TEXTAREA onkeyup=flip() name=original rows=5 cols=50></TEXTAREA> <br/><INPUT onclick=flip() type=button value=Xem> <BR>Kết quả: <BR><TEXTAREA name=flipped rows=5 cols=50></TEXTAREA> </FORM>

Share by TuoitreIT.VN
 

Facebook Comments

New posts New threads New resources

Back
Top