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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting Web page title into Email subject

Status
Not open for further replies.

cquetsch

Programmer
Mar 10, 2003
3
US
This would seem rather simple ( and it probably is ) but I am trying to figure out how to take the contents of an HTML <title> tag and place it into the subject field of an email launched by a hyperlink in a SSI include.

Thanks

chris
 
What you can do :
- give an id attribute to your title tag this way :
Code:
<Title id=&quot;myTitle&quot;>this is my page</title>
- to get it from script, write the following lines :
Code:
dim o_TitleTag, PageTitle
    Set o_TitleTag = document.getElementById(&quot;myTitle&quot;)
    PageTitle = o_TitleTag.innerHTML

Note : you can use innerText instead of innerHTML. Water is not bad as long as it stays out human body ;-)
 
This is sort of related.

I am working in vbscript and I want use the Page Title, assign it to a variable and then use it to display a navigation link as active or not.

For example:

<TITLE>International<TITLE>


Links

Home Regional National International


Code should be something like this:

If pageTitle=&quot;International&quot; Then display 'International'
Else display '<A HREF=&quot;../international/index.asp&quot;>International</A>

How would I do this as I have come to a mental block and I need it urgently.

Thanks

Mahendra
 
document.title will return the value of the page title tag

_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
OK - sorry to be a bit thick (I am a newbie to VBScript), but how would I assign this to a variable and then do the following in VBScript:

document.title = variable

If variable=&quot;X&quot; then write &quot;international&quot; else
write &quot;<A HREF=&quot;link.htm&quot;>international</A>

Thanks

In anticipation

Mahendra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top