0

I am trying to use jQuery and jQuery UI in salesforce lightning component which is embedded inside VF page. This VF page is available on console for ex. domain/my.salesforce.com/console

When I run it I am able to load only jQuery version 3.2.1 inside this console, not other jquery versions are able to load.... fine I am happy with it. but next step is to load the jQuery UI version which should be compatible with jQuery 3.2.1.

But I am getting below error when jQuery UI loads in such scenario : lightning component embedded inside vf which is shown on console.

Jquery UI error:

Uncaught TypeError: n[o].hasOwnProperty is not a function
throws at /resource/jQuery_UITEST:8:5049

what I found is jQuery v2.2.4 and jQuery UI - v1.11.2 works together well when use purely as lightning app but do not work when I embed this lightning component inside vf and that vf is part of console.

If you have any idea kindly provide your inputs.

Thanks, Akki

4

2 回答 2

0

此问题已在此处得到解答: https ://salesforce.stackexchange.com/questions/180535/jqueryui-inputinputindex-hasownproperty-is-not-a-function

简单地说:所有使用函数 hasOwnProperty 的外部库都不起作用(还),因为该函数尚未添加到 LockerService SecureWindow 对象。使用旧版本的 jquery UI 现在可以解决它(支持 1.11.4 版本)

于 2017-08-21T13:43:00.377 回答
0

当您在 Visualforce 中嵌入闪电时,事情的表现会有所不同。您是否查看过浏览器的控制台以查看抛出了哪些 JavaScript 错误?通常你会看到一些与 CORS 相关的内容。然后,您需要更新 Salesforce 中的 CORS 设置,以将错误中提到的 URL 列入白名单。 使用 CORS 进行闪电输出

于 2017-06-12T16:36:19.107 回答