create(tag,attrs,refNode,pos)
Parameter | Type | Description |
---|---|---|
tag | DOMNode | String | A string of the element to create (eg: "div","a","p","li","script","br"),or an existing DOM node to process. |
attrs | Object | An object-hash of attributes to set on the newly created node. Can be null,if you don't want to set any attributes/styles. See: |
refNode |
Optional.
Optional reference node. Used by |
|
pos | String |
Optional.
Optional positional reference. Defaults to "last" by way of |
第四个参数pos的可选值有6个:first last before after replace only
前两个参数为必须的,后两个参数可选。
lz的唠叨:今天使用该method时总也得不到想要的结果,最后发现是因为页面和脚本中的id不一致。
现在想来这个问题是可以通过查看firebug中的dom解决的。其实往往犯得都是这样的小错误,以后检查时也要注意往这方面思考。
原文地址:https://www.jb51.cc/dojo/291377.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。