Always use wp_enqueue_script?
-
Hi Guys,
do I always have to use the wp_enqueue_script function for my own javascript based on the build-in JQuery in own wordpress templates?
There are three different types of own written scripts that will be used in different own written templates:
1.) Generating and setting a variable used later in javascript.
2.) A tiny script that submits an HTML form if the user presses “Return/Enter” in an input field.
3.) A longer script that handles some user inputs and calculates some values and gives it back to the page.These scripts do not depend on other wordpress scripts. Should I still use the wp_enqueue_script function? Is that necessary for caching purposes?
Since it depends on the user input which script will be needed in the page, it looks I would add a lot of complexity to project by conditional enqueue the script in the functions.php and I cannot see any advantage by doing so.
Thank you very much in advance.
KeineKaefer
- The topic ‘Always use wp_enqueue_script?’ is closed to new replies.