Skip to Content

Include External Javascript Library in SAPUI5

Hello,

i needed to add externel Javascript libraries into one of our Fiori applications. It took me some time to figure out how this could be achived, as eg. jQuery.sap.loadScript() didn’t properly call the defined callback function. So here comes a working example – i know d3 is already included within sapui5, but i’ve needed another version as shipped in sapui5. This works also with other external js libraries.

jQuery.sap.registerResourcePath(“d3”, “../extjslib/d3”);

jQuery.sap.require(“d3”);

Have a nice day & kind regards,

Michael

5 Comments
You must be Logged on to comment or reply to a post.