谁能帮我解释一下下面这段代码

原逝 2012-02-03 12:07:45
(editor.options.relativePath ? img.getAttribute( "src", 2 ).replace( "&", "&" ) : img.src.replace( "&", "&" ))
...全文
119 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
三石-gary 2012-02-03
  • 打赏
  • 举报
回复
是editor.options.relativePath就得到src属性并用&替换&;(img.getAttribute( "src", 2 ).replace( "&", "&" )) 不是就直接用替换&;(
a13489905321 2012-02-03
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 g125989100 的回复:]
等价于
if (editor.options.relativePath ){
img.getAttribute( "src", 2 ).replace( "&", "&" ) :
}else{
img.src.replace( "&", "&" )
}
[/Quote]
+1

不耐烦 2012-02-03
  • 打赏
  • 举报
回复

等价于
if (editor.options.relativePath ){
img.getAttribute( "src", 2 ).replace( "&", "&" ) :
}else{
img.src.replace( "&", "&" )
}

87,989

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧