Please test my JavaScript widget
Moderator: Thanas
- Darth Wong
- Sith Lord
- Posts: 70028
- Joined: 2002-07-03 12:25am
- Location: Toronto, Canada
- Contact:
Please test my JavaScript widget
For those of you who don't hang around the SLAM forum, I'm testing some major revisions to my CreationTheory.Org page, including a new page which is intended to illustrate the difference between how creationists handle sequential event probability and how it's supposed to be done.
http://www.stardestroyer.net/Creationis ... ge03.xhtml
I've tested the dice-rolling widgets on Firefox and Konqueror, both on Linux. Can anyone confirm proper operation on other browsers like Safari, IE7, IE6, or Opera? The first widget is supposed to look like ten dice, all in a horizontal row. The second one starts as one die, and eventually becomes ten.
http://www.stardestroyer.net/Creationis ... ge03.xhtml
I've tested the dice-rolling widgets on Firefox and Konqueror, both on Linux. Can anyone confirm proper operation on other browsers like Safari, IE7, IE6, or Opera? The first widget is supposed to look like ten dice, all in a horizontal row. The second one starts as one die, and eventually becomes ten.
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
Confirmed. (9.23/Linux)Bounty wrote:Works fine in Opera 9.2 on Linux.
The Monarch: "Anyone wanna explain to me why my coccoon is charred?"
24: "Because you told us to blow it up"
The Monarch: "And why it is sideways?"
21: "We were following orders! You can't yell at us for following orders."
24: "Or kill us for following orders."
24: "Because you told us to blow it up"
The Monarch: "And why it is sideways?"
21: "We were following orders! You can't yell at us for following orders."
24: "Or kill us for following orders."
Page one works fine in Safari 2.0.4 (haven't installed FireFox for Mac yet, did I mention that I got a new MacBook? Well I have, and it's fab! )
Η ζωή, η ζωή εδω τελειώνει!
"Science is one cold-hearted bitch with a 14" strap-on" - Masuka 'Dexter'
"Angela is not the woman you think she is Gabriel, she's done terrible things"
"So have I, and I'm going to do them all to you." - Sylar to Arthur 'Heroes'
- FSTargetDrone
- Emperor's Hand
- Posts: 7878
- Joined: 2004-04-10 06:10pm
- Location: Drone HQ, Pennsylvania, USA
- FSTargetDrone
- Emperor's Hand
- Posts: 7878
- Joined: 2004-04-10 06:10pm
- Location: Drone HQ, Pennsylvania, USA
As for the IE7 issue, confirmed.
Error output:
Error output:
Code: Select all
Line 12
Char 3
Error: Object doesn't support this property or method.
Code 0
“Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation.” - Oscar Wilde.
- Dalton
- For Those About to Rock We Salute You
- Posts: 22637
- Joined: 2002-07-03 06:16pm
- Location: New York, the Fuck You State
- Contact:
Fails under IE6. Error on Line 47 Character 3 (Error: Object doesn't support this property or method.).
Succeeds using Safari for iPhone.
Succeeds using Safari for iPhone.
Last edited by Dalton on 2007-08-16 05:01pm, edited 2 times in total.
To Absent Friends
"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster
May the way of the Hero lead to the Triforce.
- chitoryu12
- Jedi Council Member
- Posts: 1997
- Joined: 2005-12-19 09:34pm
- Location: Florida
- Darth Wong
- Sith Lord
- Posts: 70028
- Joined: 2002-07-03 12:25am
- Location: Toronto, Canada
- Contact:
I won't be the first web developer to say this, but goddammit, I hate fucking Internet Explorer.
The JavaScript source code is fully visible in the web page source. If anyone can offer any suggestions as to why it's not working on IE, I'd appreciate it.
The JavaScript source code is fully visible in the web page source. If anyone can offer any suggestions as to why it's not working on IE, I'd appreciate it.
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
- Darth Wong
- Sith Lord
- Posts: 70028
- Joined: 2002-07-03 12:25am
- Location: Toronto, Canada
- Contact:
WTF? The only thing on line 12 of that file is a curly bracket. How does IE count line numbers?Resinence wrote:As for the IE7 issue, confirmed.
Error output:
Code: Select all
Line 12 Char 3 Error: Object doesn't support this property or method. Code 0
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
When I checked the source in IE7, this is what it gave me for line 12:
Code: Select all
dice1=new Array();
- Dalton
- For Those About to Rock We Salute You
- Posts: 22637
- Joined: 2002-07-03 06:16pm
- Location: New York, the Fuck You State
- Contact:
Dunno, but the errors manifest when you hit the start or stop buttons on either function.
I think I see a problem, though...you have an undeclared variable (t1) in function roll1. I think you need to declare the variable as 0 beforehand. Also, might I suggest preloading the dice images?
EDIT: Got it! Mike, you forgot to declare dice1 and dice2 as variables. What I did is added this to the top:
Then I added this:
var dice1=new Array();
And then this:
var dice2=new Array();
I think I see a problem, though...you have an undeclared variable (t1) in function roll1. I think you need to declare the variable as 0 beforehand. Also, might I suggest preloading the dice images?
EDIT: Got it! Mike, you forgot to declare dice1 and dice2 as variables. What I did is added this to the top:
Code: Select all
<SCRIPT type=text/javascript>
//<![CDATA[
var t1 = 0;
var t2 = 0;
var dice1=new Array();
And then this:
var dice2=new Array();
To Absent Friends
"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster
May the way of the Hero lead to the Triforce.
- Dalton
- For Those About to Rock We Salute You
- Posts: 22637
- Joined: 2002-07-03 06:16pm
- Location: New York, the Fuck You State
- Contact:
Unfortunately that just broke it in Firefox. Stand by...
EDIT: I really hate the way IE does Javascript sometimes. I'm trying to figure out why it's throwing out all these undefined errors. I wonder if it has to do with you naming one of your HTML elements the same as one of your variables, or is that the idea here? Hm.
EDIT: I really hate the way IE does Javascript sometimes. I'm trying to figure out why it's throwing out all these undefined errors. I wonder if it has to do with you naming one of your HTML elements the same as one of your variables, or is that the idea here? Hm.
Last edited by Dalton on 2007-08-16 06:17pm, edited 1 time in total.
To Absent Friends
"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster
May the way of the Hero lead to the Triforce.
- Darth Wong
- Sith Lord
- Posts: 70028
- Joined: 2002-07-03 12:25am
- Location: Toronto, Canada
- Contact:
This is why I prefer PHP over JavaScript. Unfortunately, PHP wouldn't work at all for this particular application.
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
- Dalton
- For Those About to Rock We Salute You
- Posts: 22637
- Joined: 2002-07-03 06:16pm
- Location: New York, the Fuck You State
- Contact:
Mike, I think I fixed the problem. If you rename the DIV tag IDs you have from dice1 and dice2 to something else, then change the calls in the Javascript (getElementById), it works in both IE and Firefox.Darth Wong wrote:This is why I prefer PHP over JavaScript. Unfortunately, PHP wouldn't work at all for this particular application.
To Absent Friends
"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster
May the way of the Hero lead to the Triforce.
- Starglider
- Miles Dyson
- Posts: 8709
- Joined: 2007-04-05 09:44pm
- Location: Isle of Dogs
- Contact:
I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
http://www.bitphase.com/starglider/dice ... cience.htm
- Dalton
- For Those About to Rock We Salute You
- Posts: 22637
- Joined: 2002-07-03 06:16pm
- Location: New York, the Fuck You State
- Contact:
Good one. I just renamed the DIV IDs, which basically unconfused IE.Starglider wrote:I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
To Absent Friends
"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster
May the way of the Hero lead to the Triforce.
That still works with Safari 2.0.4.Starglider wrote:I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
Η ζωή, η ζωή εδω τελειώνει!
"Science is one cold-hearted bitch with a 14" strap-on" - Masuka 'Dexter'
"Angela is not the woman you think she is Gabriel, she's done terrible things"
"So have I, and I'm going to do them all to you." - Sylar to Arthur 'Heroes'
- chitoryu12
- Jedi Council Member
- Posts: 1997
- Joined: 2005-12-19 09:34pm
- Location: Florida
Yep. Works perfectly.Starglider wrote:I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
No regression for Opera 9.23/Linux or Konq 3.5.7 .Starglider wrote:I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
The Monarch: "Anyone wanna explain to me why my coccoon is charred?"
24: "Because you told us to blow it up"
The Monarch: "And why it is sideways?"
21: "We were following orders! You can't yell at us for following orders."
24: "Or kill us for following orders."
24: "Because you told us to blow it up"
The Monarch: "And why it is sideways?"
21: "We were following orders! You can't yell at us for following orders."
24: "Or kill us for following orders."
- Darth Wong
- Sith Lord
- Posts: 70028
- Joined: 2002-07-03 12:25am
- Location: Toronto, Canada
- Contact:
Very nice. It seems to work, but I'm confused about exactly why it works, to be honest. I'm just saying that because in the roll2() function, it tests sixes1 to see if it should stop rolling, and maybe I'm just clueless at programming but it seems to me like it should be testing sixes2.Starglider wrote:I've rewritten it to work in IE, and also simplified it somewhat. I tried to stick to the original coding style. Whatever you're using to generate that HTML, it's pretty nasty.
http://www.bitphase.com/starglider/dice ... cience.htm
Code: Select all
function roll2()
{
var roll=Math.floor(Math.random()*6)+1;
var die=document.getElementById("d2-"+(sixes2+1));
die.src='die'+roll+'.gif'; die.style.visibility = "visible";
if(roll==6) sixes2++;
rolls2++;
document.getElementById("count2").innerHTML=' # of rolls: '+rolls2;
if(sixes1==10)
{
clearTimeout(timer2);
}
else
{
timer2=setTimeout("roll2()",500);
}
}
PS. About the HTML, those lower-case tags and seemingly superfluous slashes in the input and img tags are actually required for XHTML Strict validation.
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC
"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness
"Viagra commercials appear to save lives" - tharkûn on US health care.
http://www.stardestroyer.net/Mike/RantMode/Blurbs.html