FF1 and IE6 JavaScript parsers/readers/w-e are screwed up... - Anointed Youth
Anointed Youth  

Rules Moderators Donate
Go Back   Anointed Youth > Odds & Ends > Tech Talk
Join us! FAQ Members List Calendar Mark Forums Read

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}
Reply
 
LinkBack Thread Tools
Old 07-25-2006, 03:52 AM   #1
Jesdisciple Edit
Prophet/Prophetess
 
Jesdisciple's Avatar
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>
Is this everyone's computer or just mine?
__________________
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
 
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT -5. The time now is 06:58 AM.


Powered by: vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2002-2008 Anointed Youth Ministries; AY! SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58