1: a template page is defined when a problem occurs in twig, and the child page inherits it. If no code can be written outside the {%} tag, an error is reported. As shown in, a piece of code is written in the tag, and the browser reports an error. for example, my jquery is introduced in the module...
1: An error occurred while using twig.
Defines a template page, and then the child page inherits it.
If no code can be written outside the {%} tag, an error is reported. As shown in, a piece of code is written in the tag, and the browser reports an error, as shown in:
I introduced jquery on the template page. When I put this code in the js file separately and introduce it in the template page, there is no problem.
What is the twig rendering mechanism? Why cannot I use $ here?
Thank you.
I just saw that the subpage can be used after jquery is directly added to the subpage. $ Can be used.
If some public resources are referenced, this will happen on the template page. how can we ensure the availability of these resources?
Reply content:
1: An error occurred while using twig.
Defines a template page, and then the child page inherits it.
If no code can be written outside the {%} tag, an error is reported. As shown in, a piece of code is written in the tag, and the browser reports an error, as shown in:
I introduced jquery on the template page. When I put this code in the js file separately and introduce it in the template page, there is no problem.
What is the twig rendering mechanism? Why cannot I use $ here?
Thank you.
I just saw that the subpage can be used after jquery is directly added to the subpage. $ Can be used.
If some public resources are referenced, this will happen on the template page. how can we ensure the availability of these resources?
When you execute js on the page
Jq has not been introduced
It has nothing to do with Twig. But because your jquery has not been loaded, reference$
The code is executed.
Try to put the code in
Document. onload = function () {// below is your code}
Center.
Usewindow.onload
Or.