0

I don't want to put this script tag in the header of my html:

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

The main reason is the block that would cause on loading the entire page.

I want to load the script thus:

var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.jsdelivr.net/npm/[email protected]';
document.body.appendChild(script);

and I would like can add ?callback=init_input to the js URL to initialize, after places.js was loaded completely, the input element. Is possible?

I know this option is available in Google Maps API but I don't want use it.

Thank you,

Regards

0

1 Answer 1

1

this is not specific to Algolia Places or Google Maps but on how to load a script asynchronously and have a callback. It is answered on SO already: Asynchronous Script Loading Callback

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.