Dear support community!
I am wondering if anyone may know a quick fix to this issue.
Right now while applying a single java script to a WordPress block its working fine.
Once adding a second widget with similar code then it’s causing some type of conflict with the first one.. perhaps this may be because they are using the same name or sharing some type of information.
I’ll post both code snippets below & you may know a way to completely separate them so they do not recognize each-other and conflict.
These are “buy now” Java script buttons from Xsolla & they each have different values, i need to add a total of 10 – 12 but right now I cannot add more then one without some type of conflict.
Code 1:
<div id=”XS-pay2play-widget”></div> <script> var options = { access_token: “9upbu4RrjLChk8PgP42n5LqSmqANijKY”, theme : { foreground: “green”, background: “dark” }, lightbox: { height: “700px”, spinner: “round” }, target_element: “#XS-pay2play-widget” }; var s = document.createElement(“script”); s.type = “text/javascript”; s.async = true; s.src = “ s.addEventListener(“load”, function (e) { var widgetInstance = XPay2PlayWidget.create(options); }, false); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(s); </script>
Code 2:
<div id=”XS-pay2play-widget”></div> <script> var options = { access_token: “9upbGoqnbonvXqyfgaBtsDcyWnv0FXEe”, theme : { foreground: “green”, background: “dark” }, lightbox: { height: “700px”, spinner: “round” }, target_element: “#XS-pay2play-widget” }; var s = document.createElement(“script”); s.type = “text/javascript”; s.async = true; s.src = “ s.addEventListener(“load”, function (e) { var widgetInstance = XPay2PlayWidget.create(options); }, false); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(s); </script>
Thanks in advance for your kind efforts
Cody.
The blog I need help with is You can see a buy button below and there is spouse to be a buy button for all packages but they are conflicting with eachother.
I am wondering if anyone may know a quick fix to this issue.
Right now while applying a single java script to a WordPress block its working fine.
Once adding a second widget with similar code then it’s causing some type of conflict with the first one.. perhaps this may be because they are using the same name or sharing some type of information.
I’ll post both code snippets below & you may know a way to completely separate them so they do not recognize each-other and conflict.
These are “buy now” Java script buttons from Xsolla & they each have different values, i need to add a total of 10 – 12 but right now I cannot add more then one without some type of conflict.
Code 1:
<div id=”XS-pay2play-widget”></div> <script> var options = { access_token: “9upbu4RrjLChk8PgP42n5LqSmqANijKY”, theme : { foreground: “green”, background: “dark” }, lightbox: { height: “700px”, spinner: “round” }, target_element: “#XS-pay2play-widget” }; var s = document.createElement(“script”); s.type = “text/javascript”; s.async = true; s.src = “ s.addEventListener(“load”, function (e) { var widgetInstance = XPay2PlayWidget.create(options); }, false); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(s); </script>
Code 2:
<div id=”XS-pay2play-widget”></div> <script> var options = { access_token: “9upbGoqnbonvXqyfgaBtsDcyWnv0FXEe”, theme : { foreground: “green”, background: “dark” }, lightbox: { height: “700px”, spinner: “round” }, target_element: “#XS-pay2play-widget” }; var s = document.createElement(“script”); s.type = “text/javascript”; s.async = true; s.src = “ s.addEventListener(“load”, function (e) { var widgetInstance = XPay2PlayWidget.create(options); }, false); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(s); </script>
Thanks in advance for your kind efforts
Cody.
The blog I need help with is You can see a buy button below and there is spouse to be a buy button for all packages but they are conflicting with eachother.