Is java 21 supported for AEM On Premise (6.5 LTS)? I'm seeing conflicting answers. In the software downloads section where I can fetch the Oracle Java's - I see the following banner (for me the 3rd one) AEM Support for Oracle Java 17 and 21Adobe Experience Manager 6.5 LTS now supports JDK 17 and JDK...
Aha - My bad. In that case - its a different selector (using jQuery this time to keep the call shorter)
$(this).parents('.grp-yt-video').data('id')
Or more fully
_satellite.setVar('VideoID', $(this).parents('.grp-yt-video').data('id'))
The setting is handled in the custom condition (set the variable VideoID from attribute data-id from "this")
_satellite.setVar('VideoID', this.getAttribute('data-id'))
"this" assumes it was the button that was clicked (that has the data-id attribute)
Yes - You need to delete the Data Element Rule called VideoID because now the custom rule is setting that value for you.
By leaving the rule in existence - that is used instead of the setVar()
Your Data Element Custom Code isn't setting the value. When doing custom code - its to return a value. And your code is just returning the result of click() - which is just a jQuery object. Not the result of the event firing.
My preferred approach is to add a custom condition on the rule that sets...
Correct - When set, I believe you can safely assume the variable exists. So it could be referenced anytime (after initialization) without the dreaded
Uncaught TypeError: Cannot read properties of undefined
The answer is ... it depends. Inside of Adobe launch, if you are creating rules or custom conditions - The s variable will be scoped in and available to use. So no need to declare it, Adobe Launch + the Analytics extension takes care of that for you.
If you want to use the "s" variable elsewhere, ...
It looks like you may be relying on jquery (based on usage of ($). I'd check your source HTML and see if jQuery is being loaded BEFORE or AFTER Adobe launch is loaded on the page. If jQuery is loaded AFTER, you'd see the error from launch, but by the time you check the developer console - jQuery is ...