As a seasoned Java programmer, I find myself in unfamiliar territory with a project my boss assigned me. Following a discussion with an engineer from the client company, I'm tasked with creating a responsive iframe using pym.js. The issue? I have no prior experience with JavaScript. Despite studying documentation and completing some Udemy courses to grasp the fundamentals, I am struggling to implement pym.js effectively, especially since there are only a handful of questions about it on StackOverflow.
Do I need to include something like this in the <head>...</head>
:
<script src="[insert pym.js source here]"></script>
Moreover, given that I do not have access to the source files of the site where this will be deployed, is it still possible to make my "child" iframe responsive based on the "parent" width?
Any guidance or assistance would be greatly appreciated.
EDIT
Here's what I've come up with so far; hoping it's correct.
index.html
<body>
<script type="text/javascript" src="https://pym.nprapps.org/pym.v1.js"></script>
<div id="embed-1"><br>
</div>
<script type="text/javascript">
new pym.Parent("embed-1", "iframe.html");
</script>
</body>
iframe.html
<body>
<script type="text/javascript" src="https://pym.nprapps.org/pym.v1.js"></script>
</body>