|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
Join Date: Nov 2004
Posts: 800
|
Hyperlinks in Javascript
Hello, I have just taken on Javascript, because a friend needs a random quote generator. Seeing as I know html and some C etc, he figured he would ask me. I have gotten as far as setting up an array that I have working on a test page here:
http://rightcoaster.com/quotetest.html My question is how do I create a hyperlink within the array? For instance in this snippet: Quotation[0] = "You cannot depend on your eyes when your imagination is out of focus - Mark Twain"; Quotation[1] = "The goal of science and engineering is to build better mousetraps. The goal of nature is to build better mice."; Quotation[2] = "Repent! The end is coming, $9.95 at Amazon."; How could I make "Mark Twain" or Bruce Sterling or any author for that matter link to the authors webpage? If further info is needed, feel free to check the source code on the test page or ask anything you need. TIA for any help
|
|
|
|
|
|
#2 |
|
Member (10 bit)
Join Date: Nov 2004
Posts: 800
|
Ok I figured this out through trial and error if it helps anyone else. The link can be inserted right into the script, but single quotes must be used unlike conventional html, like this (the anchor is ommited for display purposes): Quotation[0] = "You cannot depend on your eyes when your imagination is out of focus - A HREF='http://www.twainquotes.com'>Mark Twain |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|