DOM question

R

Richard Trahan

I'm trying to change the document title to add an asterisk when the
document becomes "dirty", as seen on editor applications.

I use the code below. Venkman shows that everything looks as expected.
The last line is for the debugger, which indicates that the title is
changed, but it does not display.

var newtitlenode = document.createElement("title");
var newtext = document.createTextNode("MyTitle"+(dirty?"*":""));
newtitlenode.appendChild(newtext);
var headnode = document.getElementsByTagName("head").item(0);
var oldtitlenode = document.getElementsByTagName("title").item(0);
headnode.replaceChild(newtitlenode,oldtitlenode);
headnode = document.getElementsByTagName("head").item(0);

How can I get the changed title to display?

I'm running NN 7.1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top