Can anyone see why I’m getting an error for this code? I have the same code on another page and it works. At least I can’t see any difference. My eyes are a bit old though.
$w.onReady( function () {
$w( “#centers” ).onReady(() => {
$w( “#centersRepeater” ).onItemReady(($item, itemData, index) => {
$item( “#link” ).onClick((event) => {
var bug_id = local.getItem( “bug_id” );
const item = $item( ‘#centers’ ).getCurrentItem();
const center_id = item._id;
console.log( ‘Bug ID:’ + bug_id);
console.log( ‘Center ID:’ + center_id);
$item( ‘#success’ ).show(); // THIS CODE IS THROWING AN ERROR “$item is not a funtion”
$item( “#success” ).hide( “fade” , fadeOptions);
wixData.insert( 'centers_bugs' , { center_id, bug_id });
});
});
});
});