DOM question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Trahan

    DOM question

    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.create Element("title" );
    var newtext = document.create TextNode("MyTit le"+(dirty?"*": ""));
    newtitlenode.ap pendChild(newte xt);
    var headnode = document.getEle mentsByTagName( "head").item(0) ;
    var oldtitlenode = document.getEle mentsByTagName( "title").item(0 );
    headnode.replac eChild(newtitle node,oldtitleno de);
    headnode = document.getEle mentsByTagName( "head").item(0) ;

    How can I get the changed title to display?

    I'm running NN 7.1.

  • JimMenees

    #2
    Re: DOM question-Change Title

    I've always used this:
    document.title= "new title name";
    Works in Netscape too!
    -Jim

    Comment

    Working...