This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

HTML Code to get the data-object an data-object-name
#2
Add an Additional class (my-element) to the element then add this to Custom JavaScript.
Code:
$(function(){
  $('.my-element').click(function() {
    var data = this.dataset;
    var message = {
        object: data.object,
      objectName: data.objectName,
    }
    
    window.parent.postMessage(message);
  });
});

In .lp document which includes the visualization via iframe use this code to get the message:
Code:
window.addEventListener('message', function(event) {
  console.log('event data', event.data)
}, false);
Reply


Messages In This Thread
RE: HTML Code to get the data-object an data-object-name - by admin - 13.02.2025, 08:55

Forum Jump: