![]() |
| |||||||
| Tech Talk Discuss computers, website design, technology, game systems, etc. |
Welcome to the Anointed Youth forum! AY forums
is a place for Christian teens and young adults to come build relationships, have fun, share problems and dig into God's word together!
If this is your first visit, be sure to check out the welcome section to learn more about us! Oh, and while you are here why not register ? It doesn't take long to register and best of all it's free!
Either way, thank you for visiting, we hope you enjoy your stay! If you have any questions feel free to use the contact us form at the bottom of this page. God bless!! {This message disappears after registration} |
![]() |
| | LinkBack | Thread Tools |
| | #1 |
|
Jesdisciple
Edit Prophet/Prophetess ![]() | FF1 and IE6 JavaScript parsers/readers/w-e are screwed up... I was writing a code to calculate any three numbers with each of the four arithmetic signs (+,-,*,/) alternating positions in the two slots. A simplified version of the troublesome code is below. In both FF1 and IE6, it comes up with the number 11 for (x+x)/x, where x is your favorite number, and FF1 then deletes the text. (I thought maybe it was just the IE6 parser, so I tried FF1. I'm assuming FF1 has a completely separate problem.) I find that if I feed the number directly into the JS -(5+5)/5-, it comes up with 2, the correct answer, but can't handle input variables. Is it adding "1"+"1", instead of 1+1, or what? Code:
<html>
<head>
<title>
Oddness...
</title>
<script type="text/javascript">
function calc(x,y,z){
var problemChild=y+z
var yzxaddidiv=problemChild/x
ABC=Math.round(yzxaddidiv)
if(yzxaddidiv!=ABC){
yzxaddidiv="N/A"
}
document.getElementById("output").value=yzxaddidiv
}
</script>
</head>
<body>
<form id="calc">
<input type=text id="x" />
<input type=text id="y" />
<input type=text id="z" />
<button onClick=calc(x.value,y.value,z.value)>Calculate</button>
</form>
<form id="result">
<textarea id="output" rows="10" cols="30"></textarea>
</form>
</body>
</html>
__________________ In ALL things, †<><>♥!!! [><> = Jesus(I) CHrist, God's(THeous) Son(Uios), Savior] Always remember that it's not you staying strong, but you staying beside the Strong God. We will persevere to ^the end^ and celebrate to n0ne. The soul is willing, the body is weak, the spirit is determined! The only righteous thing I ever do is to let God into my heart; even that was originally selfish and I couldn't do it if He weren't available. |
| Status: Offline
| |
![]() |
| Bookmarks |
| Thread Tools | |
| |