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

Get page title and set it to a variable.

Status
Not open for further replies.

Pirellio

Programmer
Aug 25, 2008
18
US
Get page title and set it to a variable.

<title>Home Page</title>

<c:set var="theTitle" scope="page" value="<title>"/>

<meta tag name="Funnel" content="<c:eek:ut ${theTitle}/>"/>

Any idea how to achieve this goal?
 
Everything is dynamically driven

This code will be in the footer and generate differently each time its ran

I have this so far but can't get it working

<SCRIPT LANGUAGE = JavaScript>
//alert(document.title)
{
document.write("<META NAME=\"funnel\" CONTENT=\"" + document.title + "\">\n");


var meta = document.createElement('meta');
meta.setAttribute('name', 'funnel1');
meta.setAttribute('content', document.title);
document.getElementsByTagName('head')[0].appendChild(meta); }
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top