AndyCarruthers Posted July 21, 2021 Report Share Posted July 21, 2021 We use this code on one of our pages but it doesn't work on the embed page, what do we need to change in the code? I have read https://howto.caspio.com/deployment/deployment/ and can't see what to change. The datapage address is https://c0dcl362.caspio.com/dp/bd4270003fc69ba07879465eb6f3 that shows the code working the embeded page is https://womensrefuge.org.nz/about-us/whanau-protect/initialreferral/ Thanks Andy </div> <script> (function() { var widget, initAddressFinder = function() { widget = new AddressFinder.Widget( document.getElementById('InsertRecordClients_Address'), 'JNV4LRA37GUXY6QBWP9T', 'NZ', { "address_params": { "post_box": "0" }, } ); widget.on('address:select', function(fullAddress, metaData) { document.getElementById('Clients_Address').value = fullAddress; }); }; function downloadAddressFinder() { var script = document.createElement('script'); script.src = 'https://api.addressfinder.io/assets/v3/widget.js'; script.async = true; script.onload = initAddressFinder; document.body.appendChild(script); }; document.addEventListener('DOMContentLoaded', downloadAddressFinder); })(); </script> <script> (function() { var widget, initAddressFinder = function() { widget = new AddressFinder.Widget( document.getElementById('InsertRecordAlternative_address_parent_etc'), 'JNV4LRA37GUXY6QBWP9T', 'NZ', { "address_params": { "post_box": "0" }, } ); widget.on('address:select', function(fullAddress, metaData) { document.getElementById('Clients_Address').value = fullAddress; }); }; function downloadAddressFinder() { var script = document.createElement('script'); script.src = 'https://api.addressfinder.io/assets/v3/widget.js'; script.async = true; script.onload = initAddressFinder; document.body.appendChild(script); }; document.addEventListener('DOMContentLoaded', downloadAddressFinder); })(); </script> Quote Link to comment Share on other sites More sharing options...
0 TellMeWhy Posted July 21, 2021 Report Share Posted July 21, 2021 1 hour ago, AndyCarruthers said: We use this code on one of our pages but it doesn't work on the embed page, what do we need to change in the code? I have read https://howto.caspio.com/deployment/deployment/ and can't see what to change. The datapage address is https://c0dcl362.caspio.com/dp/bd4270003fc69ba07879465eb6f3 that shows the code working the embeded page is https://womensrefuge.org.nz/about-us/whanau-protect/initialreferral/ Thanks Andy </div> <script> (function() { var widget, initAddressFinder = function() { widget = new AddressFinder.Widget( document.getElementById('InsertRecordClients_Address'), 'JNV4LRA37GUXY6QBWP9T', 'NZ', { "address_params": { "post_box": "0" }, } ); widget.on('address:select', function(fullAddress, metaData) { document.getElementById('Clients_Address').value = fullAddress; }); }; function downloadAddressFinder() { var script = document.createElement('script'); script.src = 'https://api.addressfinder.io/assets/v3/widget.js'; script.async = true; script.onload = initAddressFinder; document.body.appendChild(script); }; document.addEventListener('DOMContentLoaded', downloadAddressFinder); })(); </script> <script> (function() { var widget, initAddressFinder = function() { widget = new AddressFinder.Widget( document.getElementById('InsertRecordAlternative_address_parent_etc'), 'JNV4LRA37GUXY6QBWP9T', 'NZ', { "address_params": { "post_box": "0" }, } ); widget.on('address:select', function(fullAddress, metaData) { document.getElementById('Clients_Address').value = fullAddress; }); }; function downloadAddressFinder() { var script = document.createElement('script'); script.src = 'https://api.addressfinder.io/assets/v3/widget.js'; script.async = true; script.onload = initAddressFinder; document.body.appendChild(script); }; document.addEventListener('DOMContentLoaded', downloadAddressFinder); })(); </script> I tried putting the Script in the WebPage instead, and this is what I got Quote Link to comment Share on other sites More sharing options...
Question
AndyCarruthers
I have read https://howto.caspio.com/deployment/deployment/ and can't see what to change.
The datapage address is https://c0dcl362.caspio.com/dp/bd4270003fc69ba07879465eb6f3 that shows the code working the embeded page is https://womensrefuge.org.nz/about-us/whanau-protect/initialreferral/
Thanks Andy
</div>
<script>
(function() {
var widget, initAddressFinder = function() {
widget = new AddressFinder.Widget(
document.getElementById('InsertRecordClients_Address'),
'JNV4LRA37GUXY6QBWP9T',
'NZ', {
"address_params": {
"post_box": "0"
},
}
);
widget.on('address:select', function(fullAddress, metaData) {
document.getElementById('Clients_Address').value = fullAddress;
});
};
function downloadAddressFinder() {
var script = document.createElement('script');
script.src = 'https://api.addressfinder.io/assets/v3/widget.js';
script.async = true;
script.onload = initAddressFinder;
document.body.appendChild(script);
};
document.addEventListener('DOMContentLoaded', downloadAddressFinder);
})();
</script>
<script>
(function() {
var widget, initAddressFinder = function() {
widget = new AddressFinder.Widget(
document.getElementById('InsertRecordAlternative_address_parent_etc'),
'JNV4LRA37GUXY6QBWP9T',
'NZ', {
"address_params": {
"post_box": "0"
},
}
);
widget.on('address:select', function(fullAddress, metaData) {
document.getElementById('Clients_Address').value = fullAddress;
});
};
function downloadAddressFinder() {
var script = document.createElement('script');
script.src = 'https://api.addressfinder.io/assets/v3/widget.js';
script.async = true;
script.onload = initAddressFinder;
document.body.appendChild(script);
};
document.addEventListener('DOMContentLoaded', downloadAddressFinder);
})();
</script>
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.