Forum Moderators: open

Message Too Old, No Replies

how to pass top.document.title as subject in email?

how to pass top.document.title as subject in email

         

crash325

11:00 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



Hi everyone, I've been thinking about how best to pass top.document.title as my subject line in an email?

Two things:
1. This is for intranet usage, everyone here has outlook and IE 6
2. I want to do this INLINE (ie no function calls in the head section)

Here is the original email href:

<a href="mailto:me_at_work&subject=crazy subject?body=message_goes_into_body">Send Email</a>

I'd like the "crazy subject" to actually be the
top.document.title being passed.

Help!

Thanks!

Patrick

JasonD

11:49 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



Why not use a document.write to construct the href?

crash325

2:21 am on Feb 13, 2004 (gmt 0)

10+ Year Member



D'oh! (because that would be too easy?)

Thanks for the tip. I"ll test it out and see how far I get.

One of my problems is that I also have a OnClick window open occuring as well, so I need to figure out how to combine both the document.write(code) AND the onClick(code) within the HTML.

Thats what always messes me up, the ' and the " and the ( and ) and blah blah blah.

I'll try to do a cobbled together document.write and see where it goes.

Anyone else have a tip on this?

Thanks!

Patrick

Purple Martin

2:56 am on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't forget you can escape quotes and double-quotes with a backslash where they're inside a string. You can even escape backslashes, so it's possible to nest them as deep as you like (but it starts getting confusing!).

e.g.

<script>document.write('<a onClick="myFunction(\'word\')">')</script>