get option inside of a return function?
-
Thanks everyone…I think this should be simpler than I’m making it, but I’m a total n00b trying to figure this out. Essentially I have a return function:
function cryptoexchange_function(){ return'<script> const config = { sourceAssetAddress: null, sourceAmountDecimal: null, destinationAssetAddress: null, destinationAmountDecimal: null, apiKey: "5a8d0a24-7cce-4b3e-9203-1d88034dd64e", partnerContractAddress: "XXXXXXXXXXXXXXXXXXXXXXXXXX", }; const nodeId = "totle-widget"; !function(){const t=document.createElement("script");t.type="text/javascript";const e=()=>{TotleWidget.default.run(config,document.getElementById(nodeId))};t.readyState?t.onreadystatechange=function(){"loaded"!=t.readyState&&"complete"!=t.readyState||(t.onreadystatechange=null,e())}:t.onload=function(){e()},t.src="https://widget.totle.com/latest/dist.js",document.getElementsByTagName("head")[0].appendChild(t)}(); </script><p><center><small><b>Swap your tokens below to get the best prices across all decentralized crypto exchanges.</b></small></center></p><div id="totle-widget"></div><p></p></html>'; }On the line below, I’d like the partnerContractAddress value to be an option I created in the admin called custom_contract_address OR a default value. Any tips or ideas?
partnerContractAddress: “XXXXXXXXXXXXXXXXXXXXXXXXXX”,
Every way I’ve researched breaks the function…
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘get option inside of a return function?’ is closed to new replies.