Get the last script element in the page and use getAttribute
to get the parameters. The last script element is always the current one, so you don't need to work with IDs.
// Get all script tags
var scriptElements = document.getElementsByTagName("script");
// Get the number of scripts
var numberOfScripts = scriptElements.length;
// The current script is the last script in the list
var currentScript = scriptElements[numberOfScripts - 1];
// Now you can retrieve the attribute
var param = JSON.parse(currentScript.getAttribute("data-param"));
This is the same, only shorter and less readable:
var scriptElements = document.getElementsByTagName("script");
var param = JSON.parse(scriptElements[scriptElements.length - 1].getAttribute("data-param"));