Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple lnk question 1

Status
Not open for further replies.
Jun 9, 2004
188
US
I am not a javascript programmer at all and you can probably tell by my question Any way I am trying to add a prompt for people to create link. The problem is that the \ is not coming up when I submit.

theText = "<a href=directory\" " + url + "\" target=\"_blank\"><u>" + txt + "<\/u><\/a>";

Result= <a href=aimages"test.PDF" target="_blank"><u>My Link</u></a>

Goal = <a href=aimages\test.PDF" target="_blank"><u>My Link</u></a>




full script
Code:
function doLink() {
        url = prompt("Enter file name (eg. document1.PDF):", "Enter name");
        if (url != null) {
                txt = prompt("Enter the text description for this link:", "Enter text description");
                if (txt != null) {
                        theText = "<a href=aimages\" " + url + "\" target=\"_blank\"><u>" + txt + "<\/u><\/a>";
                        addText(theText);
                }
        }
}
[\code]
 
Try this:

Code:
theText = "<a href=\"directory\\" + url + "\" target=\"_blank\"><u>" + txt + "<\/u><\/a>";

*cLFlaVA
----------------------------
"Holy crip he's a crapple!
 
I just noticed I was using the wrong slash. But that works if I ever need it. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top