Search code examples
salesforcesalesforce-service-cloudsalesforce-lightning

jQuery UI not loading when lightning component embedded inside VF on console


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


Solution

  • This question has been answered here: https://salesforce.stackexchange.com/questions/180535/jqueryui-inputinputindex-hasownproperty-is-not-a-function

    Simply said: All external libs that use the function hasOwnProperty are not working (yet) because the function has not been added to the LockerService SecureWindow object. Using an older version of jquery UI solves it for now (version 1.11.4 is supported)