PDA

View Full Version : script grabbing pageurl and pagetitle


Ivoman
August 22nd, 2007, 17:59
Hi guys,

Say I want to have the following at the bottom of each page on my site:

"Want to post a link to this page on a forum?
Use this code:
pagetitle"

How could I achieve this? Can a script call up the current pageurl and pagetitle and fill them in? Cause I for one would know how to do that...

Tell me. :)

Thanks!

Ivoman
August 22nd, 2007, 20:41
Ok, I managed to figure out a solution afterall. Thanks anyway, guys.

<script language="JavaScript">
<!--
document.write ("<p>")
document.write ("<a href='"+location.href+"'>"+document.title+"</a>")
document.write ("</p>")
// -->
</script>

Maybe this piece of code isn't clean - I have no idea - but it works.

Remarks are always welcome.

Yves