简体   繁体   English

XPages是否可以通过AMD loader加载外部javascript库?

[英]XPages Is it possible loading external javascript libraries via AMD loader?

In Domino 9 dojo comes with the AMD loader which seems to be interfering with loading of external javascript libraries eg Jquery Mobile, Fullcalendar. 在Domino 9中,dojo附带了AMD加载器,它似乎在干扰外部javascript库的加载,例如Jquery Mobile,Fullcalendar。

The quick solution is to load these external libraries before the dojo libraries. 快速的解决方案是在dojo库之前加载这些外部库。 But this requires the Xpage property: "Use runtime optimized Javascript and CSS resources" to be set. 但这需要设置Xpage属性:“使用运行时优化的Javascript和CSS资源”。

The problem with this is that images referenced in compressed css files will break. 问题在于压缩的css文件中引用的图像将损坏。 Eg font-awesome, jqueryui. 例如font-awesome,jqueryui。

This is a major flaw in the product that these references have to be recoded in the css files for it to work. 这是产品的主要缺陷,必须将这些引用重新编码到css文件中才能起作用。

So the question is can eg fulcalendar and it's dependencies be loaded via AMD in Xpages so we don't have to recode all css files referencing images? 因此,问题是,例如fulcalendar及其依赖关系是否可以通过AMD在Xpages中加载,这样我们就不必重新编码所有引用图像的css文件了吗?

What exatly is your problem with loading jquery. 什么是您加载jquery的问题。 I am loading jquery and other js libraries like select2, dgrowl, jgrid without any problems 我正在加载jquery和其他js库,例如select2,dgrowl,jgrid,没有任何问题

When using the "Use runtime optimized Javascript and CSS resources" setting, there are some additional options you can set directly in xsp.properties to stop aggregation of CSS files like font-awesome. 使用“使用运行时优化的Javascript和CSS资源”设置时,可以在xsp.properties中直接设置一些其他选项来停止CSS文件的聚合,例如font-awesome。 In this instance use 'xsp.resources.aggregate.css=false' and you will be good to go. 在这种情况下,请使用“ xsp.resources.aggregate.css = false”,您会很高兴。

See http://lotusnotus.com/lotusnotus_en.nsf/dx/xpages-performance-dojo-widgets-and-resource-aggregation.htm for full details of all of the options. 有关所有选项的完整详细信息,请参见http://lotusnotus.com/lotusnotus_en.nsf/dx/xpages-performance-dojo-widgets-and-resource-aggregation.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM