How does jQuery.sap.require work?

前端 未结 4 1727
囚心锁ツ
囚心锁ツ 2021-01-07 11:22

Does SAPUI5 load the libraries each time I call jQuery.sap.require(\"someLibrary\")? For instance if I am calling the above statement in multiple modules in my

4条回答
  •  甜味超标
    2021-01-07 12:02

    In case someone still considers to use jQuery.sap.require, be aware that it sends only sjax requests which should be avoided.

    The use of jQuery.sap.require is synchronous and considered as "bad practice" because syncXHR is deprecated by the Web Hypertext Application Technology Working Group. (Source: Modules and Dependencies)

    Instead, the current best practice is to use sap.ui.define or .require for asynchronous module loading:

    
    
    
                                     
                  
提交回复
热议问题