JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 19th, 2004, 02:12 PM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Inserting a link into a mailto link???

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

Reply With Quote
  #2  
Old January 19th, 2004, 07:21 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old January 20th, 2004, 11:14 AM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I need to insert a link called INVOICE into the body of the email that directs to the entire url

Reply With Quote
  #4  
Old January 20th, 2004, 11:23 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to dhouston
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.

Reply With Quote
  #5  
Old January 20th, 2004, 11:29 AM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #6  
Old January 20th, 2004, 06:31 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
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>"

Reply With Quote
  #7  
Old January 20th, 2004, 07:23 PM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #8  
Old January 20th, 2004, 07:45 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
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.

Reply With Quote
  #9  
Old January 20th, 2004, 07:47 PM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #10  
Old January 21st, 2004, 08:58 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to dhouston
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.

Reply With Quote
  #11  
Old January 21st, 2004, 09:02 AM
Sandow Sandow is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx for the reply, but now i get the link plus the text <a href=.... haha i am going insane...

Reply With Quote
  #12  
Old January 21st, 2004, 10:37 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to dhouston
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Inserting a link into a mailto link???


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap