Sign Up   Sign In

Join the community!
Sign in now with your Facebook account.
ForumsTechnicalThread
Forum
Advanced Search
Filter     |   View Watchlist
[ Print Friendly ] [ Watch Thread ]


Wiki HTML Help [ 1 ]
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#1   Posted 5 months ago
    [ Reply ]   [ Quote ]
Im trying to build the UK Grifball wiki with the help from a few other users. We are trying to make a random comment generator. We have this so far but it doesn't work:

<HTML>
<Body>
<form name="random"><input type="text" name="random" size=100 value=""></form>
<SCRIPT LANGUAGE="JavaScript">function getMessage()

{// create array of Grifball factsvar ar = new Array(20)
ar[0] = "If all else fails blame Stranglers connection"
ar[1] = "Ryan can't stiff arm"
ar[2] = "GBGB are the only UK team to win their division with a perfect record"
ar[3] = "Sexy Action Newsteam is my favorite team name ever"
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)"
ar[5] = "The Shak attack is not a real move"
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)"
ar[7] = "Definition of a Carkito- Failing with style"
ar[8] = "Grifball is fun"
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier"
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'"
ar[11] = "Muffin- 'I can give you what you want!'"
ar[12] = "Can anyone tell me why no-one leaves SA anymore?"
ar[13] = "I'm still pushing for The Fumblethingy to be formed"
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)"
ar[15] = "Does the term 'bonking' come from Scouts in TF2?"
ar[16] = "UK Grifball- Served with tea and crumpets"
ar[17] = "UK Grifball- We've got this or croquet"
ar[18] = "UK Grifball- The best thing sinec the cork pipe"
ar[19] = "Wales is the best Grifballing nation"
var now = new Date()var sec = now.getSeconds()document.random.random.value="Here's somthing for ya: " + ar[sec % 20]}getMessage()
//-->
</SCRIPT>
</Body>
</HTML>

Can anyone tell me where im going wrong?
frazeerives
frazeerives
#2   Posted 5 months ago
    [ Reply ]   [ Quote ]
Haha!
I love the random messages dude!
But alas, i have no idea what basically all that means!
WindowsRules
WindowsRules
#3   Posted 5 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
In reply to Sir_Jimmmy, #1:
{// create array of Grifball factsvar ar = new Array(20)
- This isn't right it should be something like this

// create array of Grifball facts
var ar = new array(20);

ar[0] = "If all else fails blame Stranglers connection";
ar[1] = "Ryan can't stiff arm";
ar[2] = "GBGB are the only UK team to win their division with a perfect record";
ar[3] = "Sexy Action Newsteam is my favorite team name ever";
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)";
ar[5] = "The Shak attack is not a real move";
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)";
ar[7] = "Definition of a Carkito- Failing with style";
ar[8] = "Grifball is fun";
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier";
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'";
ar[11] = "Muffin- 'I can give you what you want!'";
ar[12] = "Can anyone tell me why no-one leaves SA anymore?";
ar[13] = "I'm still pushing for The Fumblethingy to be formed";
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)";
ar[15] = "Does the term 'bonking' come from Scouts in TF2?";
ar[16] = "UK Grifball- Served with tea and crumpets";
ar[17] = "UK Grifball- We've got this or croquet";
ar[18] = "UK Grifball- The best thing sinec the cork pipe";
ar[19] = "Wales is the best Grifballing nation";
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#4   Posted 5 months ago
    [ Reply ]   [ Quote ]
In reply to WindowsRules, #3:

It didn't work, the link to the wiki is ukgrifball.wikispaces.com/ new pages are open for anyone to edit so if you have any ideas please try.
Rogue100
Rogue100
#5   Posted 5 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
In reply to WindowsRules, #3:

<HTML>
<Body>
<form name="random">
<input type="text" name="random" id="random" size=100 value="" />
</form>

<SCRIPT LANGUAGE="JavaScript">
function getMessage(){
// create array of Grifball facts
var ar = new array(20);

ar[0] = "If all else fails blame Stranglers connection";
ar[1] = "Ryan can't stiff arm";
ar[2] = "GBGB are the only UK team to win their division with a perfect record";
ar[3] = "Sexy Action Newsteam is my favorite team name ever";
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)";
ar[5] = "The Shak attack is not a real move";
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)";
ar[7] = "Definition of a Carkito- Failing with style";
ar[8] = "Grifball is fun";
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier";
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'";
ar[11] = "Muffin- 'I can give you what you want!'";
ar[12] = "Can anyone tell me why no-one leaves SA anymore?";
ar[13] = "I'm still pushing for The Fumblethingy to be formed";
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)";
ar[15] = "Does the term 'bonking' come from Scouts in TF2?";
ar[16] = "UK Grifball- Served with tea and crumpets";
ar[17] = "UK Grifball- We've got this or croquet";
ar[18] = "UK Grifball- The best thing sinec the cork pipe";
ar[19] = "Wales is the best Grifballing nation";

var now = new Date();
var sec = now.getSeconds();
document.random.value="Here's somthing for ya: " + ar[sec % 20];
}
getMessage();
</SCRIPT>
</Body>
</HTML>
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#6   Posted 5 months ago
    [ Reply ]   [ Quote ]
In reply to Rogue100, #5:

annoyingly still not working
pal_sch
pal_sch
MPhys
#7   Posted 5 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
In reply to Rogue100, #5:

So close. Array is capitalised and the call to document.random.value should just be to random.value. You can also strip out the form and input names, leaving just the id. Might want to edit it on the full page but works sandboxed.
<HTML>
<Body>
<form>
<input type="text" id="random" size=100 value="" />
</form>

<SCRIPT LANGUAGE="JavaScript">

// create array of Grifball facts
var ar = new Array(20);

ar[0] = "If all else fails blame Stranglers connection";
ar[1] = "Ryan can't stiff arm";
ar[2] = "GBGB are the only UK team to win their division with a perfect record";
ar[3] = "Sexy Action Newsteam is my favorite team name ever";
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)";
ar[5] = "The Shak attack is not a real move";
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)";
ar[7] = "Definition of a Carkito- Failing with style";
ar[8] = "Grifball is fun";
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier";
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'";
ar[11] = "Muffin- 'I can give you what you want!'";
ar[12] = "Can anyone tell me why no-one leaves SA anymore?";
ar[13] = "I'm still pushing for The Fumblethingy to be formed";
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)";
ar[15] = "Does the term 'bonking' come from Scouts in TF2?";
ar[16] = "UK Grifball- Served with tea and crumpets";
ar[17] = "UK Grifball- We've got this or croquet";
ar[18] = "UK Grifball- The best thing sinec the cork pipe";
ar[19] = "Wales is the best Grifballing nation";

function getMessage(){
var now = new Date();
var sec = now.getSeconds();
random.value="Here's somthing for ya: " + ar[sec % 20];
}
getMessage();
</SCRIPT>
</Body>
</HTML>
EDIT - moved the array outside the function so that you don't rebuild it if you call the function again, if you choose to change the text later.

Post edited 6/21/09 5:21PM
slntprdtr
slntprdtr
#8   Posted 5 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
In reply to Sir_Jimmmy, #1:
ar[18] = "UK Grifball- The best thing sinec the cork pipe"
You may want to change sinec to since
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#9   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to pal_sch, #7:

Still does not work, I think this wiki is broken.

ukgrifball.wikispaces.com/

Could you please try it for yourself on the test page, to test html click edit and then the tv symbol(Embed Widget)
radknutz
radknutz
#10   Posted 4 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
In reply to Sir_Jimmmy, #9:

<HTML>
<Body>
<form>
<input type="text" id="random" size=100 value="" />
</form>

<SCRIPT LANGUAGE="JavaScript">

// create array of Grifball facts
var ar = new Array(20);

ar[0] = "If all else fails blame Stranglers connection";
ar[1] = "Ryan can't stiff arm";
ar[2] = "GBGB are the only UK team to win their division with a perfect record";
ar[3] = "Sexy Action Newsteam is my favorite team name ever";
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)";
ar[5] = "The Shak attack is not a real move";
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)";
ar[7] = "Definition of a Carkito- Failing with style";
ar[8] = "Grifball is fun";
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier";
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'";
ar[11] = "Muffin- 'I can give you what you want!'";
ar[12] = "Can anyone tell me why no-one leaves SA anymore?";
ar[13] = "I'm still pushing for The Fumblethingy to be formed";
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)";
ar[15] = "Does the term 'bonking' come from Scouts in TF2?";
ar[16] = "UK Grifball- Served with tea and crumpets";
ar[17] = "UK Grifball- We've got this or croquet";
ar[18] = "UK Grifball- The best thing sinec the cork pipe";
ar[19] = "Wales is the best Grifballing nation";

function getMessage(){
var now = new Date();
var sec = now.getSeconds();
document.write("Here's somthing for ya: " + ar[sec % 20])
}
getMessage();
</SCRIPT>
</Body>
</HTML>
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#11   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to radknutz, #10:

Still nothing..
pal_sch
pal_sch
MPhys
#12   Posted 4 months ago
+ 1 Cool     [ Reply ]   [ Quote ]
<HTML>
<Body>
<form action="">
<input type="text" id="random" size=100 value="" />
</form>

<SCRIPT type="text/javaScript">

// create array of Grifball facts
var ar = new Array(20);

ar[0] = "If all else fails blame Stranglers connection";
ar[1] = "Ryan can't stiff arm";
ar[2] = "GBGB are the only UK team to win their division with a perfect record";
ar[3] = "Sexy Action Newsteam is my favorite team name ever";
ar[4] = "Hellfire has the the highest kill count in the UK with 1579 (to date)";
ar[5] = "The Shak attack is not a real move";
ar[6] = "Hellfire has the highest betrayl count in the UK with 67 (to date)";
ar[7] = "Definition of a Carkito- Failing with style";
ar[8] = "Grifball is fun";
ar[9] = "Drink 4 litres of Sunny D a day to become a real life bomb carrier";
ar[10] = "Chief- 'EXIT!!! What are you doing you stupid pillock that's our goal'";
ar[11] = "Muffin- 'I can give you what you want!'";
ar[12] = "Can anyone tell me why no-one leaves SA anymore?";
ar[13] = "I'm still pushing for The Fumblethingy to be formed";
ar[14] = "Secretryan28 leads in bomb scores in the UK with 113 (to date)";
ar[15] = "Does the term 'bonking' come from Scouts in TF2?";
ar[16] = "UK Grifball- Served with tea and crumpets";
ar[17] = "UK Grifball- We've got this or croquet";
ar[18] = "UK Grifball- The best thing sinec the cork pipe";
ar[19] = "Wales is the best Grifballing nation";

function getMessage(){
var now = new Date();
var sec = now.getSeconds();
var random = document.getElementById("random");
random.value="Here's somthing for ya: " + ar[sec % 20];
}
getMessage();
</SCRIPT>
</Body>
</HTML>
Try that. It worked for me on the test page.
Tick is online
Tick
krooooooooze
#13   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to pal_sch, #12:

yeah that works, cheers for the help I'm still learning
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#14   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to pal_sch, #12:

Thanks a lot help was very much appreciated
Rogue100
Rogue100
#15   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to pal_sch, #7:

doh, should have tested it first, oh well
Strider165
Strider165
workworkwork
FORUM MOD
#16   Posted 4 months ago
    [ Reply ]   [ Quote ]
Glad you all got it figured out. For future reference, you may find it easier to post code using [code] code here [/code].
Tick is online
Tick
krooooooooze
#17   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to Strider165, #16:

do you mind if we keep this unlocked, just in case we need any more help with any other features, like I asy were new to this
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#18   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to Tick, #17:

Would be nice we are hoping to make a great wiki
Strider165
Strider165
workworkwork
FORUM MOD
#19   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to Tick, #17:

That's why I left it unlocked.

I am going to change your title though, to make it a little clearer.
Sir_Jimmmy
Sir_Jimmmy
DukeDevlin
#20   Posted 4 months ago
    [ Reply ]   [ Quote ]
In reply to Strider165, #19:

Thanks a lot
[ 1 ]