Skip to content Skip to sidebar Skip to footer

Load Script Async?

EDIT: I want to save input data from my form into Firebase database The input with id='field0' and button with onClick'submitPost()'

Solution 1:

Try this, by using the load event of the script tag: https://jsfiddle.net/7mnns4dk/6/

Basically just use:

script.load = function() {
  // enter code that needs the script to be loaded here
}

Also it works with jQuery as you wrote it, just move the submitPost function so that it is accessible by the button: https://jsfiddle.net/7mnns4dk/7/


Post a Comment for "Load Script Async?"