Use the U method in ThinkPHP to call js file instances. ThinkPHP uses the U method to call js file instances. this example describes how to use the U method to call js files in ThinkPHP. Share it with you for your reference. The details are as follows: in TP, js file instances are called using the U method in MoD ThinkPHP.
This example describes how to use the U method to call js files in ThinkPHP. Share it with you for your reference. The details are as follows:
In TP, you can call functions directly in the template file. U is one of them. The manual has its usage:
The code is as follows:
{: U ('user/insert ')}
First, change the suffix of the js file to html (this will not affect), then write a JsAction, and call it in it:
?
| 1 2 3 4 5 6 7 8 9 |
Class JsAction extends Action { Function nav (){ $ This-> display ('index: js: nav '); } } ?> // Finally, modify the JS link in the left framework: |