Introduction:
Here i am going to explain how to load css or js files conditionally.
Step 1:
For example if u want to load some js files really if need not for all the times. There is a solution to load files conditionally with jquery.
On btnLoadJs click the file will be downloaded. Not for all the time when page is loaded.
Here i am going to explain how to load css or js files conditionally.
Step 1:
For example if u want to load some js files really if need not for all the times. There is a solution to load files conditionally with jquery.
- <script>
- $('#btnLoadJs').on('click', function () {
- $.getScript('../js/awsome-complete.js', function (data, textStatus, jqxhr) {
- });
- });
- </script>
On btnLoadJs click the file will be downloaded. Not for all the time when page is loaded.
No comments:
Post a Comment