xbl12
Programmer
- Dec 12, 2006
- 66
Hi;
I'd like to ask a question.
I got a paragraph, and i want the letter of A will change to N and the letter of P will change to A when i click the
the link of the "click me to change the letter" .
My code as following, but it doesn't do anything, could anyone help, please.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "<html>
<head>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
<script type="text/javascript">
function window.onload(){
var s="A P";
var t="N A";
function String.prototype.s2t(){
var k=’’;
for(var i=0;i<this.length;i++) k+=(s.indexOf(this.charAt(i))==-1)?this.charAt(i):t.charAt(s.indexOf(this.charAt(i)))
return k;
}
</script>
<script type="text/JavaScript" language="JavaScript">
function s2t(){
document.body.innerHTML=document.body.innerHTML.s2t();
}
</script>
</head>
<body>
<a href="javascript:s2t()">click me to change the words</a> <br>
Vince Cervi, 41, who once held the Australian heavyweight title belt,
died from a wound to the abdomen at Preston, after the alleged confrontation reports the Herald Sun.
</body>
</html>
I'd like to ask a question.
I got a paragraph, and i want the letter of A will change to N and the letter of P will change to A when i click the
the link of the "click me to change the letter" .
My code as following, but it doesn't do anything, could anyone help, please.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "<html>
<head>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
<script type="text/javascript">
function window.onload(){
var s="A P";
var t="N A";
function String.prototype.s2t(){
var k=’’;
for(var i=0;i<this.length;i++) k+=(s.indexOf(this.charAt(i))==-1)?this.charAt(i):t.charAt(s.indexOf(this.charAt(i)))
return k;
}
</script>
<script type="text/JavaScript" language="JavaScript">
function s2t(){
document.body.innerHTML=document.body.innerHTML.s2t();
}
</script>
</head>
<body>
<a href="javascript:s2t()">click me to change the words</a> <br>
Vince Cervi, 41, who once held the Australian heavyweight title belt,
died from a wound to the abdomen at Preston, after the alleged confrontation reports the Herald Sun.
</body>
</html>