I'm just starting out in Lightning (Summer 16 sandbox) and I'm trying to use jQuery, but getting the error: Uncaught Error: Access denied for insecure view in aura_prod.js:1:27.
I'm testing in a very simple component:
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId,force:appHostable" access="global">
<ltng:require scripts="/resource/jQuery_2_2_4/jquery-2.2.4.js"
styles="{!$Resource.slds105 + '/assets/styles/salesforce-lightning-design-system.min.css'}"
afterScriptsLoaded="{!c.init}"/>
<div class="slds">
<button id="clickme" onclick="{!c.boo}">Click Me</button>
</div>
</aura:component>
With a controller:
({
init: function(component, event, helper) {
helper.doInit(component);
}
})
And a Helper:
({
doInit : function(cmp) {
var self=this;
$( document ).ready(function() {
console.log( "ready!" );
});
$('#clickme').click(function(ev) { self.clicked(cmp, ev); });
},
clicked: function(cmp, ev) {
console.log("boo");
}
})
I'm not sure what I'm doing wrong. jQuery does work, the console.log("ready!") in the helper does get executed.
Thanks!