homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Extract and Display Page Titles
Automatically display page title in body

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

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?



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

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:



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

This script is solely for my own use.

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


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

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


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

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved