NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Javascript novice with small problem...

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-03-2004, 07:45 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Apr 2004
Location: South East UK
Posts: 10
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:
????: NamePros.com http://www.namepros.com/programming/29188-javascript-novice-with-small-problem.html

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, 11:32 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
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.
????: NamePros.com http://www.namepros.com/showthread.php?t=29188

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, 07:22 AM THREAD STARTER               #3 (permalink)
New Member
Join Date: Apr 2004
Location: South East UK
Posts: 10
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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:26 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger