Run javascript with different data depending on button click

Viewed 39

I'm sorry for not being able to maybe provide all info but i think this will be enough. I have a external javascript file which i cannot edit, it calls an Iframe on my page and the data on this iframe depends on the data-profile-id="xx".

It is called like this:

<script src="link to external js file here" data-profile-id="xxx" defer></script>

The js file then locates this div <div class="button-container"></div> and shows a button on it.

My problem is i have 6 different data-profile-id's so lets say

001 002 003 004 005 006

and by running 001 i can't load the rest of them since it will only be checking the first one.

Somehow i'd want the button to hold the data-profile-id="xxx" and then pass the integer to the js file. is that possible?

for example:

<div class="agendo-button-container" data-profile-id="005"></div>

makes the script in head go:

<script src="link to external js file here" data-profile-id="005" defer></script>
1 Answers
Related