m
unread,Apr 28, 2011, 9:55:13 AM4/28/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Breadcrumb Developers
I am having a problem getting a link to work- what I want to do is
have the link go to a random page. I have some javascript that will
generate a random number & store it in the variable whichChoice. All I
seem to be able to do is pass this to the next page and display it as
text (see below). But what I want to be able to do is have a link
based on that random number, something like [Take me to a random page]
(<whichChoice>) but I can't get the formatting to work. I tried a
bunch of different combinations- quotes, brackets... keep getting
errors... how do I get a link using the value of whichChoice, not
literally 'whichChoice'
(1) This is page 1
<script>
function get_random()
{
var ranNum= Math.floor(Math.random()*5);
return ranNum;
}
var whichChoice = get_random();
</script>
[Go to page 2](2: whichChoice)
(2)This is page 2 <%= whichChoice %> [Go Back](1)
(3)This is page 3
(4)This is page 4
(5)This is page 5