In jQuery, I used the parent () function for the immediate parent of any element,
$ (this). Parent ();
The same I want in the dojo is my loop this way. / Var / url = dojo.attr (node, "href"); // I want to get the node's parent, which will be completely different for each iteration)};
Someone gave me a hint, I tried to use the parent. I am trying to add the parent to the node like this
dojo.place ("& lt; span style = 'color: green' & gt; url & lt; / Span & gt; ", query (node) .parent ()," last ");
I'm getting this error in firebug
type error: _365.appendChild function is not
Regards
Adam
Here are some problems:
-
dojo.place ()
ordojo / dom-build :: location ()
dojo / nodeList
for use by APIdojo / Query
. In place of such use modules such asdojo / nodeList-manipulate
ordojo / nodeList-dom
. Since you are a jQuery user, I recommend using thedojo / nodeList-manipulate
as it does a mix of jQuery APIs. - To retrieve the origin of a DOM node, you actually have the
parent ()
method, but that part of the API is available only when youDojo / nodeList-traverse
.
An example using this feedback:
is required (["dojo / query "Dojo / Nodist-Trowers", "Dojo / Node List-Heripple", "Dojo / domReady!"], Function (query) {query (". EntryURL"). ForEach (function (node, index, ARM) { Query (node) .parent ("& lt; span style = 'color: green' & gt; url & lt; / span & gt;);});});
JSFiddle:
No comments:
Post a Comment