Faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes

Entry

How do I pass the page title (document.title) into a url on the same page?

Apr 11th, 2004 19:53
Ronald Woods, David Kaye,


If you want to include the page title as a part of the URL, you could 
do something like this: 
<html>
<head>
<title>Test page</title>
</head>
<body>
Hey: <script language="javascript"><!--
  var sURL = 'link.asp?referertitle='+document.title;
  document.write('<'+'a href="'+sURL+'">ASDF</a>');
--></script>
</body>
</html>
But I'm not sure that's what you're after...