/    Sign up×
Community /Pin to ProfileBookmark

Variable to be used in href

[B]Check out the code and tell me, how can i use the variable as a href link.[/B]

var rand_link = new Array ();
rand_link[0]=”asdhrfe22k”;
rand_link[1]=”iqh3wjhs8s”;
rand_link[2]=”snbds7s8h3″;
rand_link[3]=”=jh99shhs99″;
rand_link[4]=”shdbfh3h83″;

var rand = Math.floor(5 * Math.random());

var ref = rand_link[rand];

document.write(rand_ques[rand]);
document.write(rand_ans[rand]);
document.write(“<a href=http://www.youtube.com [with the variabel “ref”]>Click here</a>”);

[B]where, rand_ques and rand_ans are arrays of ques and ans and their corr link is in rand_link.[/B]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@letmehaveagoJul 13.2010 — This page url may give a hint:

[CODE]
http://www.webdeveloper.com/forum/showthread.php?t=232686
[/CODE]
Copy linkTweet thisAlerts:
@geekyvirginauthorJul 14.2010 — Oh ... wat are you trying to say ..
×

Success!

Help @geekyvirgin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...