Calling the contract function through web3js is not successful, but it can be done on remix ide

the front end uses web3js, to call a simple contract function with an error. But it can be successful on remix.
here is the contract function, which is a simple loop, but there is also an error. What"s going on? Thank you.

clipboard.png

metamask

clipboard.png

clipboard.png

Mar.14,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4077f-43394.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4077f-43394.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?