I can't get how the scripts in a page are loaded. I have jQuery plugins that depend on other scripts. I am using the timeago jQuery plugin. I have loaded this script in head in order:
<script src="<?php echo base_url().'content/scripts/jqueryEngine/jquery.js' ?>" type="text/javascript"></script> //jquery library
<script src="<?php echo base_url().'content/scripts/timeago.js' ?>" type="text/javascript"></script> //timeago
<script src="<?php echo base_url().'content/scripts/myscript.js' ?>" type="text/javascript"></script> // Custom scripts that contains ajax.
And in document ready
I am initializing timeago. But this is not working for me. In the console, the browser shows timeago is not functioning. What I want is to ensure that timeago has already loaded before any other script runs. My scripts also contains multiple Ajax calls that rely on timeago.
The order of the script tags in your HTML basically determines the order of your scripts loading. So you have that setup correctly already.
A couple of points to help you debug your issue:
Based on the comments below, it seems that the file is not being loaded by the browser, and you need to be able to debug things like this using the chrome developer tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With