#17852 closed defect (invalid)
domConstuct.place
Reported by: | artl | Owned by: | artl |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | HTML | Version: | 1.9.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
http://dojotoolkit.org/documentation/tutorials/1.9/hello_dojo/
example code segment 2: """ <script>
require([
'dojo/dom', 'dojo/dom-construct'
], function (dom, domConstruct) {
var greetingNode = dom.byId('greeting'); domConstruct.place(' Dojo!', greetingNode);
});
</script>
""" domConstruct.place error. later examples with:
var greeting = dom.byId('greeting'); greeting.innerHTML += ' from Dojo!';
works.
Firefox debug: TypeError?: Argument 1 of Node.appendChild is not an object. dojo.js:154
safari(osx) does not work msie does not work
Change History (6)
comment:1 follow-up: 3 Changed 8 years ago by
Component: | General → HTML |
---|---|
Owner: | set to artl |
Status: | new → pending |
comment:2 follow-up: 4 Changed 8 years ago by
also, it's possible you need a 'dojo/domReady!'
dependency
comment:3 Changed 8 years ago by
Status: | pending → new |
---|
Replying to bill:
Well, do you have a node with id=greeting? Please attach the actual testcase you ran rather than just a code snippet.
yes <h1 id="greeting">Hello</h1> the tutorial link provided have the code i've tried. copy and paste.
html served from cherrypy on staticdir
comment:4 Changed 8 years ago by
Replying to neonstalwart:
also, it's possible you need a
'dojo/domReady!'
dependency
add dojo/domReady!, same result.
like ive said, later example with var greeting = dom.byId('greeting'); greeting.innerHTML += ' from Dojo!'; works, so dom should be ready?
comment:5 follow-up: 6 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
the example has domConstruct.place('<i> Dojo!</i>', greetingNode);
but you have domConstruct.place(' Dojo!', greetingNode);
. this is an important difference.
from the docs for `domConstruct.place'
node: DOMNode|DocumentFragment?|String
id or node reference, or HTML fragment starting with "<" to place relative to refNode
your node
doesn't match this criteria but the one in the tutorial does.
comment:6 Changed 8 years ago by
Replying to neonstalwart:
the example has
domConstruct.place('<i> Dojo!</i>', greetingNode);
but you havedomConstruct.place(' Dojo!', greetingNode);
. this is an important difference.from the docs for `domConstruct.place'
node: DOMNode|DocumentFragment?|String
id or node reference, or HTML fragment starting with "<" to place relative to refNode
your
node
doesn't match this criteria but the one in the tutorial does.
Thanks. I see now.
js been disabled on the tuturial page. the code i see/copy is missing the 'code view' w/<i>, perhaps there should be some warning bout that.
Well, do you have a node with id=greeting? Please attach the actual testcase you ran rather than just a code snippet.