How to access tags inside the head tag?[SOLVED]

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

How to access tags inside the head tag?[SOLVED]

Post by raghavan20 »

Let's assume a situation where I use AJAX in a page. I have a form where I enter some keyword and retrieves some information everytime I enter a keyword. But most of us do change the title of the page in traditional Web applications for every time you fetch new information from the database but in an AJAX application we make changes only to the form values. We disregard to change the appropriate values of title and other meta tags.

I understand this issue and I am thinking that every time new content is loaded into the form, the title tag and meta tags within the head tags should be changed appropriately. So, can you tell me is it possible to access HEAD tags using DOM?
Last edited by raghavan20 on Mon Dec 12, 2005 4:16 pm, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Search...

Code: Select all

alert(document.title);
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

title = document.title
meta = document.getElementsByTagName("META");
:wink:
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Thanks for your replies guys...
Post Reply