[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-03-2004, 06:45 AM   #1 (permalink)
New Member
 
Join Date: Apr 2004
Location: South East UK
Posts: 10
13.00 NP$ (Donate)

martyn187 is an unknown quantity at this point


Talking Javascript novice with small problem...

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 :-)
martyn187 is offline  
Old 05-03-2004, 10:32 PM   #2 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


Re: Javascript novice with small problem...

Quote:
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>");
deadserious is offline  
Old 05-04-2004, 06:22 AM   #3 (permalink)
New Member
 
Join Date: Apr 2004
Location: South East UK
Posts: 10
13.00 NP$ (Donate)

martyn187 is an unknown quantity at this point


Thanks, it works fine now, I can act so dumb!
martyn187 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 06:14 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85