我正在寻找一种方法来了解用户是否在JavaScript/jQuery窗口中显示和显示对象(如Div,img等).
当我说"显示并可见"时,用户不会滚动页面足以让对象可见(如果你知道我的意思).但是如果用户滚动页面并且div不再可见(在窗口外),我正在寻找的功能应该知道.
我被困在一个可能很多新的 SuiteScript黑客都会遇到的问题上。
正如SuiteScript p.的官方文档所写的那样。243,有这个 JS 用于使用 GET 方法检索记录。
// Get a standard NetSuite record
function getRecord(datain) {
return nlapiLoadRecord(datain.recordtype, datain.id); // e.g recordtype="customer", id="769"
}
// http://rest.na1.netsuite.com/app/site/hosting/restlet.nl?script=22&deploy=1&recordtype=customer&id=769
Run Code Online (Sandbox Code Playgroud)
但是,当我在 NetSuite 端尝试EXACT片段时,datain.recordtype未定义。(并且返回应该只返回文本,顺便说一句。)
幸运的是,我自己找到了解决方案。在下面检查我的答案。