Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
^__^
My attorney discourages sharing personal information. ....it's a joke...get it?
Javascript random array help?
Hi there!
I'm trying to make a random writing prompt generator with options.
Character + Character + Prompt
The characters are split up into groups. I'd like to be able to have checkboxes so that I can choose which groups I want characters from. For example:
America [ ]
China [ ]
France [ ]
Brazil [ ]
But I'm totally stuck as to how to do that :\
Here's my code at the moment:
=============================================
<head>
<script language="JavaScript">
<!--
var people = new Array(
"C 1",
"C 2",
"C 3",
"C 4",
"C 5",
"C 6",
"C 7,"
"C 8",
"C 9",
"C 10"
);
var prompt = new Array(
"Prompt 1",
"Prompt 2",
"Prompt 3",
"Prompt 4",
"Prompt 5",
"Prompt 6",
"Prompt 7",
"Prompt 8",
);
function generateFic() {
var randomfic = "";
// Who 1
var index1 = Math.floor(Math.random() * people.length);
randomfic += people[index1] + " and ";
// Who 2
var index2 = index1;
while (index2 == index1) {
index2 = Math.floor(Math.random() * people.length);
}
randomfic += people[index2] + " <br> <br> <em>prompt:</em> ";
// prompt
var index4 = Math.floor(Math.random() * prompt.length);
randomfic += prompt[index4] + " ";
document.getElementById("FicPrompt").innerHTML = randomfic;
}
// -->
</script>
</head>
<body>
<div id="FicPrompt">
</div>
<script language="JavaScript">
<!--
generateFic();
//-->
</script>
<br><br>
<a href="javascript:generateFic();">Grab another</a>
</body>
==========================================
Is there anybody that can help me out?
Let me know if I need to clarify anything!
Thank you! :)
^^
2 AnswersProgramming & Design9 years agoPHP includes and redirecting from a .html to a .php?
Hi there ^^
I have about 100 pages on a website, and it takes a lot of time to change the navigation on every single file every time I want to change something. So, I thought a php include would be a good idea...
<?php include("header.php"); ?>
I saved my file (index.html) and it didn't work.
Then I saved my file as index.php and it did work.
Am I going to have to change all of my files to .php and then use a redirect so that visitors don't end up on the wrong page?
Thanks in advance for the help :)
4 AnswersProgramming & Design10 years agoHow to relplace typing out nav-bar (menu) every page with javascript?
I have 75 different HTML pages. Everytime I make a change to the menu (or navigation bar) I have to go through and change it in 75 different pages. Is there a way I can just link the menu to a different file or something?
3 AnswersProgramming & Design10 years agoHow to make an alert box (javascript) only pop up the first 5 times someone visits a site?
I have an alert box:
<script type="text/javascript">
function show_alert()
{
alert("TEXT HERE~!");
}
</script>
How can I make it so that this only pops up the first 5 times someone comes to my site?
2 AnswersProgramming & Design10 years agoChemistry help. molecular weight and formula.?
A compound is found to be 62.1% C, 5.21% H, 12.1% N, and 20.7% O. When 4.94 g is volatilized to a gas at 90°C and 510 torr it fills a 475 mL flask. Find the molecular weight and the molecular formula.
-
I need help on how to do the problem, not just the answer, please.
2 AnswersChemistry10 years agoHow to incorporate a login/shopping cart into your website?
Like how can a user make an account to shop on your website?
What would be the code for something like that?
3 AnswersProgramming & Design1 decade agoIs it possible for an IPOD to transfer a virus to a laptop?
2 AnswersMusic & Music Players1 decade agoCan I send a letter internationally with a return address in a different country then I am sending from?
like, if I am on vacation in New York City, can I send a letter to France with the return address in Brazil?
1 AnswerPacking & Preparation1 decade agoCan I send a letter internationally with a return address in a different country then I am sending from?
like, if I am on vacation in New York City, can I send a letter to France with the return address in Brazil?
1 AnswerInternational Organizations1 decade agoIs my grammar and kanji correct in this sentence?
Or, actually, should I say, "How would a native Japanese rephrase this sentence"
各曲の私がして、大好きです聞くよりのmdm
I'm trying to say
"Each song I listen to makes me love MDM more."
2 AnswersLanguages1 decade agoIs my Japanese grammar and kanji/hiragana correct in the sentence?
すみませんが、 私は英語でこの手紙の残りの部分を記述する必要があります。
--
In English, I mean
"I'm sorry, but I will have to write the rest of this letter in english."
--
Thanks so much (again!)
4 AnswersLanguages1 decade agoIs my Japanese grammar and kanji correct in this sentence?
今日は、 アリスです。アメリカからです。 私は2年間日本語を勉強しています。すみませんでも 私の日本語はあまりうまくありません。Moi Dix Mois の音楽が大好きです。CDの本当にありがとう。
What I mean to say in English is:
Hello, my name is Alice. I am from america. I've been studying Japanese for two years, I'm sorry but my Japanese is not very good. I love Moi Dix Mois's music.Thank you very much for the CD.
4 AnswersLanguages1 decade agoHow do I link other youtube accounts to my main one?
Like, if I have a second channel, how can I make it so that they are linked?
2 AnswersYouTube1 decade agoHow do I connect my laptop to my tv (directv)?
How can I connect by laptop to my TV or directv box? Like to watch a movie?
1 AnswerTVs1 decade agois an IPOD USB cable "male" or "Female"?
2 AnswersMusic & Music Players1 decade agoBest material to make a beanie out of (sewing, not kitting)?
3 AnswersHobbies & Crafts1 decade agoWhat would be a good pesudonym for me?
I'd like to keep my real first name, Alice, but I want to use a false surname. What do you think would sound well with "Alice"?
3 AnswersBooks & Authors1 decade agoWhat do you call the person who takes the dead body away?
You know, in the old times it was like a sickly looking creepy old skinny man?
Not the gravedigger! Someone who takes the dead body away from where they died?
Thanks so much!
7 AnswersBooks & Authors1 decade agoChemistry help: Would water boiling be a chemical or physical change?
I know it's a physical change because it involves a change of state (liquid to gas) and keeps the same substance, but if it produces heat, doesn't that make it a chemical change?
Someone please explain this to me...
1 AnswerChemistry1 decade ago