From bb20fa07636e1f52915ba67a45bdf6d331a6f6a3 Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Fri, 21 Aug 2009 22:42:07 +0100 Subject: [PATCH] dom: Markedly beefed up the Element#update and Element#insert documentation. [#161 state:resolved] --- src/dom/dom.js | 58 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index 861eb9f..b912758 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -171,8 +171,21 @@ Element.Methods = { * Replaces _the content_ of `element` with the `newContent` argument and * returns `element`. * + * `newContent` may be in any of these forms: + * - [[String]]: A string of HTML to be parsed and rendered + * - [[Element]]: An Element instance to insert + * - ...any object with a `toElement` method: The method is called and the resulting element used + * - ...any object with a `toHTML` method: The method is called and the resulting HTML string + * is parsed and rendered + * * If `newContent` is omitted, the element's content is blanked out (i.e., * replaced with an empty string). + * + * If `newContent` is a string and contains one or more inline `