Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么在原型JS中使用child.nodeValue.replace()时会添加()呢_Replace_Prototypejs_Parentheses_Nodevalue - Fatal编程技术网

为什么在原型JS中使用child.nodeValue.replace()时会添加()呢

为什么在原型JS中使用child.nodeValue.replace()时会添加()呢,replace,prototypejs,parentheses,nodevalue,Replace,Prototypejs,Parentheses,Nodevalue,我使用以下原型JS代码替换文本: document.body.select('*:not(script)').each(function(el){ $A(el.childNodes).each(function(child){ if (child.nodeType === 3) { // only get text nodes child.nodeValue = child.nodeValue.replace('an Appointment', 'a Session').

我使用以下原型JS代码替换文本:

document.body.select('*:not(script)').each(function(el){
  $A(el.childNodes).each(function(child){
    if (child.nodeType === 3) { // only get text nodes
      child.nodeValue = child.nodeValue.replace('an Appointment', 'a Session').replace('Appointment', 'Session').replace('appointment', 'session');
    }
  })
});
它一直在工作,但由于某种原因,现在在
请求会话
之后添加了一个
()
,即
请求约会

我一直未能追查到这个问题。
()
不会添加在任何其他替换词之后


您可以在此处查看我的iframe的来源:。

页面内容中似乎包含了paren。尝试禁用javascript并转到页面-您将看到“选择约会()”

页面内容中似乎包含了预约。尝试禁用javascript并转到页面-您将看到“选择约会()”