Loading External Libraries in SAP UI5



External libraries can be inserted using a file in a normal script tag. SAP UI5 also supports JQuery so it can be done by extending your heading from the controller.

var s = document.createElement("script");
s.type = "text/javascript";
s.src = "http://domainname.com/somescript";
$("head").append(s);

You can also add any external file using the following command −

jQuery.sap.registerModulePath("ModuleName","http://Domainname.com");
jQuery.sap.require("ModuleName.jsFileName");

You can navigate to the following path for more details−

https://blogs.sap.com/2016/04/22/include-external-javascript-library-in-sapui5/


Updated on: 2020-03-12T12:26:25+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements