|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Ok how do i explain this one?? I need to insert a link into a mail to link. No problem right?? That's what I thought, here is the catch.. The url of the link is always different, it's a modified invoice done in asp.. therefore i am using top.location.href . However, the url is very long because it has to pull over all of the asp variables... I only want the link to say "INVOICE" The script I am using now does work, but it inserts the entire URL... For the life of me I can not figure this out... I have posted in several forums to no avail. Here is the script I am currently using...
var subject subject=top.location.href document.writeln("<a class='link' href='mailto:?BODY=" + escape(subject) + "'>Click Here</a>") here is an example of the url it has to insert: "http://www.littlejimmys.com/manager/newinvoice.asp?id=1069&up=&up2=100&rp=&rp2=0.00&ud=&ud2=0.00&ms=&ms2=100&rd=0.00&cc=&dd=&cc2=0.00&op=&op2=0.00&cow=&cowi=&cow2=0.00&cm=&cm2=0.00&ld=&ld2=0.00" Thank You in Advance, Donna ![]() |
|
#2
|
||||
|
||||
|
I don't really understand what the problem is exactly. What part of the URL do you want in the body of the email? You didn't specify.
|
|
#3
|
|||
|
|||
|
I need to insert a link called INVOICE into the body of the email that directs to the entire url
|
|
#4
|
||||
|
||||
|
You're not going to want to use js in an email anyway, as most browsers have that turned off by default now for security reasons. Just have your asp write the email using its variables.
|
|
#5
|
|||
|
|||
|
The mailto link is only so the company can administratively send the invoice into email.. The invoice is in asp pulling from a mysql database, the modifications which are done administratively do not save to the database, the mailto is blank because i don't know who it is being mailed to. The manager of the company fills that in. The link done in js works now, but it inserts the entire length of the url as the link. Can i not just get it to say invoice?
|
|
#6
|
||||
|
||||
|
I would go with dhouston's idea, and just use ASP to create the mailto: link. I still don't understand what it is you are trying to do. For a link to "say" invoice "<a href="mailto:foo.htm">Invoice</a>"
|
|
#7
|
|||
|
|||
|
but that has to be inside another link that says click here... so when they click that then the email pops up with the other link inside the body of it... so i have to insert a link inside a link, which i did... but it inserts the entire location into the body of the email and i only want it to say invoice
|
|
#8
|
||||
|
||||
|
Ahhh - I finally understand - sorry. It was a tricky thing to explain. Hmm - I've just tried a few little experiments, and haven't had a lot of luck.
I probably wouldn't create the email via javascript tho. I would use CDOSYS to create and send the email via ASP. Much easier, and you can insert anything you like into the email. |
|
#9
|
|||
|
|||
|
Thank you so much for your help... I have been pulling my hair out on this one... I am not even sure how to explain it.. ugg
![]() |
|
#10
|
||||
|
||||
|
Maybe you could post the whole js (if it's fairly short)? I'm still not clear on what you mean by putting a link within a link. Or, if you can't do the whole js, maybe explain the code you did post. What's "BODY"? Is something to replace that?
Oh, wait, I think I see. Could you try something like this: Code:
document.writeln("<a class='link' href='mailto:?BODY=" + escape("<a href=\"" + subject + "\">INVOICE</a>") + "'>Click Here</a>")
Or if the escape needs to be just around the subject, move the extra quoted stuff outside the escape function. |
|
#11
|
|||
|
|||
|
Thanx for the reply, but now i get the link plus the text <a href=.... haha i am going insane...
|
|
#12
|
||||
|
||||
|
Yeah, I think this just isn't going to work. In order for the email client to render what you send it as HTML, the content-type has to be set to text/html. I doubt you can do that when just opening up a mail link to compose a new message. You'd probably fare better if you just wrote a little form in asp that sends the mail, to which you could prepend the appropriate headers so that the link would render properly.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Inserting a link into a mailto link??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|