According to a school assignment, only one property of the Document object can be dynamically changed after a Web page is rendered. Is it body or cookie?
views:
234answers:
3
+1
Q:
Javascript: What Document object property can be dynamically rendered after a Web page is rendered?
+2
A:
You can manipulate the body contents, but can't assign to the body property. It's a readonly property. You can however set or get the cookies associated with the document. Reference: http://www.w3schools.com/htmldom/dom_obj_document.asp
tvanfosson
2009-03-03 19:22:49
+2
A:
The assignment is wrong: all of the following properties have special meaning in the DOM and are writeable:
- alinkColor
- bgColor
- cookie
- fgColor
- linkColor
- title
- vlinkColor
The list above should work across different browsers. There are others (like charset
and defaultCharset
for IE, or some of these for Geckos) which don't, and not all of them are standard.
Christoph
2009-03-03 19:31:43
Document Object Properties are as follows: body, cookie, domain, lastModified, referrer, title and url.
Andrew Clark
2009-03-03 19:34:30
@Clark: who decided that: `lastModified` is non-standard as well, so why do you exclude other non-standard properties with cross-browser support?
Christoph
2009-03-03 19:37:04
@Clark: the `color` properties are even standard, just deprecated
Christoph
2009-03-03 19:55:21
A:
I think your assignment is based on out-of-date technology.
with Javascript, you can do anything after the webpage is rendered. e.g. changing the id name, properties, eventHandler, etc of any DOM dynamically.
Murvinlai
2009-03-03 19:35:25