为了账号安全,请及时绑定邮箱和手机立即绑定

请问这个js库的方法是什么意思?

请问这个js库的方法是什么意思?

守着一只汪 2018-10-15 16:09:35
这是一个Photoshop 的xml.js 库的一个对象方法,我不会英语,用 有道翻译 的又看不懂..请有空的人能教教我怎么用吗?我只能用点赞汇报大家了,谢谢...replace() xmlObj.replace (name, value); name An element or attribute name, with or without the 0-based position index of a specific element, or the wildcard string “*”. ? If no position index is supplied, replaces the value of all matching elements. ? If the wildcard is supplied, replaces the value of all contained elements. When anelement contain subelements, those are removed,  and only the replacementvalueremains.value An XML object or any value that can be converted to a String with toString(). Replaces one or more property values in this node.If the named element does not exist, appends the given value as a text element. Returns this XML object. setChildren() xmlObj.
查看完整描述

1 回答

?
海绵宝宝撒

TA贡献1809条经验 获得超8个赞

这是个替换函数。
name是你需要替换的元素或属性名,可以指定下标index,或者通选符‘*’。
如果不提供下标,所有符合name的元素都会被替换。
如果是‘*’,替换所有包含的元素,如果元素有子元素,则直接移除。
value是个XML对象或者任何能被toString()函数转换为字符串的值。
特殊情况:如果name不存在,则直接将value作为一个文本元素append进去。
返回的是XML对象。

查看完整回答
反对 回复 2018-11-01
  • 1 回答
  • 0 关注
  • 558 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号