Forum Moderators: open

Message Too Old, No Replies

Extract and Display Page Titles

Automatically display page title in body

         

j2trumpet

8:35 pm on Nov 11, 2009 (gmt 0)

10+ Year Member



I want to create a kind of directory list of all the photo galleries on my site with their ID number and title. I know how to extract the ID number form the URL, but am unsure of how to extract the page titles of each gallery automatically. Can someone please help me?

Fotiman

9:26 pm on Nov 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This should really be done server side (using PHP, ASP, etc.) as a JavaScript solution will be inaccessible to people (and search engines) with JavaScript disabled. However, you can get the title (as defined in the <title> element in your <head>) via:

document.title

j2trumpet

9:32 pm on Nov 11, 2009 (gmt 0)

10+ Year Member



This script is solely for my own use.

How would I use document.title to find the title of another page?

Fotiman

10:02 pm on Nov 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I misunderstood your request.
I don't think there is a good client side solution.

j2trumpet

10:05 pm on Nov 11, 2009 (gmt 0)

10+ Year Member



Alright. I post this in the PHP forum then. I was trying to create a page I could run off my local machine without having to use a server, but I'll make it work. Thanks for the help.