borninlyoko's Profile
Reputation: 7
Worker
- Group:
- Authors
- Active Posts:
- 349 (0.27 per day)
- Joined:
- 03-December 09
- Profile Views:
- 6,222
- Last Active:
Jan 14 2013 11:57 AM- Currently:
- Offline
Previous Fields
- Country:
- US
- OS Preference:
- Windows
- Favorite Browser:
- FireFox
- Favorite Processor:
- Intel
- Favorite Gaming Platform:
- PC
- Your Car:
- Mercedes
- Dream Kudos:
- 150
Latest Visitors
-
macosxnerd101 
14 Jan 2013 - 11:19 -
ThrowsException 
25 Sep 2012 - 07:09 -
Sho Ke 
21 Sep 2012 - 17:14 -
modi123_1 
21 Sep 2012 - 13:51 -
vegyta 
30 Jul 2012 - 15:49
Posts I've Made
-
In Topic: Simple Javascript Calculator Not Completing
Posted 24 Sep 2012
Sho Ke, on 21 September 2012 - 02:54 PM, said:Usually the first thing you should do when debugging is look at the error console. If you had done that, you would've seen this right as the page loads(using Firefox's error console)
Quote
[16:52:05.825] SyntaxError: missing ; before statement @ file:///<directory here>
It refers to this line:
calculate(){
What's that supposed to do?
http://www.quirksmod...s/function.html
Additionally, the text inside an input field is its value, not innerHTML.
Ah, now I feel like an idiot
I forgot to declare the damned function! Thank you very much
-
In Topic: Simple Javascript Calculator Not Completing
Posted 21 Sep 2012
-
In Topic: Simple Javascript Calculator Not Completing
Posted 21 Sep 2012
modi123_1, on 21 September 2012 - 02:04 PM, said:What?
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Flash Player Bitcoin Miner Calculator</title> <!--Also Posted to DreamInCode for help, username borninlyoko, verification for moderator modi123_1--> <script type="text/javascript"> calculate(){ var users = document.getElementById('musers').value; var timespent = document.getElementById('timespent').value; var btcps = 0.000000000617283950; var timeday = timespent/30; var userday = users/30; var calcresult = userday*timeday*btcps + 'BTC'; document.getElementById('result').innerHTML = calcresult; } </script>
Specifically:
<!--Also Posted to DreamInCode for help, username borninlyoko, verification for moderator modi123_1-->
-
In Topic: Simple Javascript Calculator Not Completing
Posted 21 Sep 2012
modi123_1, on 21 September 2012 - 01:45 PM, said:Looks like the same code found here. Where was your input in this?
It is the same code, I posted a comment in the OP code there showing that it was my code from the beginning!
Sorry about that
I forgot about the plagiarism issues here.
-
In Topic: Javascript Clock Doesn't Work
Posted 22 Apr 2012
Atli, on 20 April 2012 - 07:31 PM, said:Random hint: You are missing the Doctype. You should never leave that out, not even when testing. (Tests done in Quirks Mode are not reliable!)
JMRKER, on 20 April 2012 - 07:49 PM, said:<!DOC HTML>
That, by the way, is not a valid Doctype declaration.
Tried adding a doctype, but it still doesn't function. Here's the updated code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <script type="text/javascript"> function timeUpdate() { var ctime = new Date(); var weekday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); var monthname = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var curSec = ctime.getSeconds(); var curMin = ctime.getMinutes(); var curHour = ctime.getHours(); var curDay = ctime.getDate(); var curWeekDay = weekday[ctime.getDay()]; var curMonth = monthname[ctime.getMonth()]; var curYear = ctime.getFullYear(); var ampm; if (curSec < 10) { curSec = "0" + curSec; } if (curMin < 10) { curMin = "0" + curMin; } if (curHour < 12) { ampm = "AM"; } else { ampm = "PM"; } function suffixDay() { if (curDay == 1) { return "st"; } else if (curDay == 2) { return "nd"; } else if (curDay == 3) { return "rd"; } else if (curDay >= 4 && curDay <= 31) { return "th"; } else { return "ERROR"; } } var timeDate; timeDate = curWeekDay; timeDate += ", the "; timeDate += curDay; timeDate += suffixDay(); timeDate += " of "; timeDate += curMonth; timeDate += ", "; timeDate += curYear; timeDate += " "; timeDate += curHour; timeDate += ":"; timeDate += curMin; timeDate += ":"; timeDate += curSec; timeDate += " "; timeDate += ampm; document.getElementById("clock").innerHTML = timeDate; } </script> </head> <body> <span id="clock"> </span> </body> </html>
EDIT: Fixed it, somewhere along the line, I accidentally phased out the body "onload" attribute, so my working code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <script type="text/javascript"> function timeUpdate() { var ctime = new Date(); var weekday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); var monthname = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var curSec = ctime.getSeconds(); var curMin = ctime.getMinutes(); var curHour = ctime.getHours(); var curDay = ctime.getDate(); var curWeekDay = weekday[ctime.getDay()]; var curMonth = monthname[ctime.getMonth()]; var curYear = ctime.getFullYear(); var ampm; if (curSec < 10) { curSec = "0" + curSec; } if (curMin < 10) { curMin = "0" + curMin; } if (curHour < 12) { ampm = "AM"; } else { ampm = "PM"; } function suffixDay() { if (curDay == 1) { return "st"; } else if (curDay == 2) { return "nd"; } else if (curDay == 3) { return "rd"; } else if (curDay >= 4 && curDay <= 31) { return "th"; } else { return "ERROR"; } } var timeDate; timeDate = curWeekDay; timeDate += ", the "; timeDate += curDay; timeDate += suffixDay(); timeDate += " of "; timeDate += curMonth; timeDate += ", "; timeDate += curYear; timeDate += " "; timeDate += curHour; timeDate += ":"; timeDate += curMin; timeDate += ":"; timeDate += curSec; timeDate += " "; timeDate += ampm; document.getElementById("clock").innerHTML = timeDate; } </script> </head> <body onload="timeUpdate(); setInterval('timeUpdate()', 1000)"> <span id="clock"> </span> </body> </html>
My Information
- Member Title:
- D.I.C Regular
- Age:
- 18 years old
- Birthday:
- April 12, 1995
- Gender:
-
- Interests:
- C++, VBS, Dancing, DeeJaying,
- Full Name:
- Brandon Anzaldi
- Years Programming:
- 1
- Programming Languages:
- C++, VBS, HTML
Contact Information
- E-mail:
- Private
- Website URL:
-
http://www.freebie-zone.co.cc
Friends
|
|


Find Topics
Find Posts
View Reputation Given

|
Comments
Anarion
27 Feb 2010 - 11:48.Aaron
16 Feb 2010 - 18:13