Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

判断条件的Javascript命令返回值功能执行错误 #357

Open
fyang93 opened this issue Apr 25, 2024 · 1 comment
Open

判断条件的Javascript命令返回值功能执行错误 #357

fyang93 opened this issue Apr 25, 2024 · 1 comment

Comments

@fyang93
Copy link

fyang93 commented Apr 25, 2024

按照官方教程的操作,先循环采集数据,数据中包含字段“出价次数”,但是在判断条件中使用Field["出价次数"]出现以下错误:

执行JavaScript出错,请检查JavaScript语句是否正确:return Field["出价次数"] > 0
错误信息: JavascriptError: javascript error: Field is not defined(Session info: chrome=124.0.6367.61)
@NaiboWang
Copy link
Owner

NaiboWang commented Apr 25, 2024

Field[""]的指令只能在执行阶段进行测试,设计阶段不能直接测试,请在任务执行阶段测试此条件是否能被正确处理。

另外,你写的语句恰巧可以成立,但注意在其他情况下一般这么写是不对的,因为Field[""]如果不是数字而是字母或汉字,如three,那么你的语句会被转换为return three > 0,此时不符合JS的语法格式或者你想要的逻辑(会把three识别成一个变量而不是字符串),应该在Field[""]前后加上引号,使得转义语句变成return 'three' > 0才符合想要进行字符串比较的意图。

Repository owner deleted a comment from Pinkolinka11 Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants