Dynadot โ€” .com Transfer

Javascript novice with small problem...

SpaceshipSpaceship
Watch

martyn187

Established Member
Impact
0
I am using javascript for a radio station that displays something different at different hours of the day.... For example:

case 0 :show="Midnight - 1am";break;
case 1 :show="1am - 2am";break;
case 2 :show="2am - 3am";break;

This is all working fine and is displayed using document.write :

document.write("<font size=2><B>"+ show +"</B></font><br>")

It shows the text ok and that is fine. I am trying to get this to be a hyperlink though, I have done it before but am completely stuck with doing it again! I know that you need to have the .html in the document.write and then the ../pagename in the case section. If i do it like this:

document.write(""+ show +".html") then it displays the text ../pagename.html, HOWEVER if I do this:

document.write("<a href="+ show +".html") Then nothing displays. The code is all correct to display just as text, but I cannot for the life of me remember how I got it to link.

If anyone can shed any light on it I would be eternally grateful. The code on this post may not be perfected but in theory it works fine.

All the best,

Martyn

Apologies BTW for the re-post this is more info on my javascript plea post :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Re: Javascript novice with small problem...

Originally posted by martyn187
HOWEVER if I do this:

document.write("<a href="+ show +".html") Then nothing displays. The code is all correct to display just as text, but I cannot for the life of me remember how I got it to link.

If anyone can shed any light on it I would be eternally grateful. The code on this post may not be perfected but in theory it works fine.

All the best,

Martyn

Apologies BTW for the re-post this is more info on my javascript plea post :)

Maybe you forgot the end >CLICK</a> part ?

I think something like this should work.
Code:
document.write("<a href="+ show +".html>CLICK</a>");
 
0
•••
Thanks, it works fine now, I can act so dumb!
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back