but an error, initNECaptcha undefined will be reported with the append tag.
is the script tag of append executed asynchronously?
but an error, initNECaptcha undefined will be reported with the append tag.
is the script tag of append executed asynchronously?
to answer your question first, is the script tag of append executed asynchronously? The answer is depending on the situation. It can be asynchronous. Default is Synchronize. But from your code, it looks like Synchronize.
so why does Synchronize cause your "asynchronous" illusion?
the reason is that the web IO operation that the browser requests to download js is asynchronous. When the code is downloaded and returned to the browser, without adding the asynchronous attribute, the browser will be blocked from rendering Synchronize execution. I just said that the network IO operation of requesting download js is asynchronous, so when the code requests to download the js file again, your initialization code has already been executed, so it is obvious that the code will report an error.
so to solve your problem, you need to write the initialization code into the script onLoad event .
I hope my answer will be helpful to you. My personal homepage is https://azl397985856.github.io/, and the Nuggets homepage https://juejin.im/user/58af98.
look at the plug-in source code and stumble upon this writing: type Axis = both | x | none ; import type {Element as ReactElement, Node as ReactNode} from react ; what does type mean? import React from react ; import PropTypes f...
there is an array like data, about 500 + data. I want to form an array every 10 items and put them all in arr. Ask for advice const data = [ { img: a }, { img: a }, { img: a }, { img: a }, { img: a }, { img: a }, {...
problem description case: there is a input box of such a form. It is required that the input data should not be greater than 10 or less than 1. It is also required that the difference between the value entered last time and that entered last time sh...