客户端脚本和用户事件脚本之间的区别

时间:2021-01-20 20:11:42

We use client script for client side validations purpose,what are the scenarios we use user event script for server side validations and what is the main purpose of user event script.

我们使用客户端脚本进行客户端验证,我们使用用户事件脚本进行服务器端验证的场景是什么,以及用户事件脚本的主要目的是什么。

1 个解决方案

#1


2  

In short...

简而言之...

  1. Client scripts are client side scripts (executed in your browser). These are what you would generally think about as standard JavaScript.
  2. 客户端脚本是客户端脚本(在浏览器中执行)。这些是您通常认为的标准JavaScript。
  3. User event scripts are executed on these server. These run based on events that trigger them, but never as an immediate client side action. These run:
    • before a page loads (making changes to the record before the client receives it).
    • 页面加载之前(在客户端收到记录之前更改记录)。
    • Before the record is submitted (making changes based on what was received back from the client).
    • 在提交记录之前(根据从客户端收到的内容进行更改)。
    • After the record is submitted (making changed based on the final results of the record after it has been placed in the database).
    • 提交记录后(根据记录放入数据库后的最终结果进行更改)。
  4. 用户事件脚本在这些服务器上执行。它们基于触发它们的事件运行,但从不作为直接的客户端操作。这些运行:在页面加载之前(在客户端接收之前对记录进行更改)。在提交记录之前(根据从客户端收到的内容进行更改)。提交记录后(根据记录放入数据库后的最终结果进行更改)。

Hope that helps. Here is the documentation for all of the script types, as well: SuiteScript 2.0 Script Types.

希望有所帮助。以下是所有脚本类型的文档:SuiteScript 2.0脚本类型。

#1


2  

In short...

简而言之...

  1. Client scripts are client side scripts (executed in your browser). These are what you would generally think about as standard JavaScript.
  2. 客户端脚本是客户端脚本(在浏览器中执行)。这些是您通常认为的标准JavaScript。
  3. User event scripts are executed on these server. These run based on events that trigger them, but never as an immediate client side action. These run:
    • before a page loads (making changes to the record before the client receives it).
    • 页面加载之前(在客户端收到记录之前更改记录)。
    • Before the record is submitted (making changes based on what was received back from the client).
    • 在提交记录之前(根据从客户端收到的内容进行更改)。
    • After the record is submitted (making changed based on the final results of the record after it has been placed in the database).
    • 提交记录后(根据记录放入数据库后的最终结果进行更改)。
  4. 用户事件脚本在这些服务器上执行。它们基于触发它们的事件运行,但从不作为直接的客户端操作。这些运行:在页面加载之前(在客户端接收之前对记录进行更改)。在提交记录之前(根据从客户端收到的内容进行更改)。提交记录后(根据记录放入数据库后的最终结果进行更改)。

Hope that helps. Here is the documentation for all of the script types, as well: SuiteScript 2.0 Script Types.

希望有所帮助。以下是所有脚本类型的文档:SuiteScript 2.0脚本类型。