Welcome Guest, Not a member yet? Register   Sign In
Loading views vs loading JS files
#1

[eluser]Unknown[/eluser]
Is one superior to the other and if so which? My co-worker says that we need to load JS files rather than views with JS inside them due to browser caching. But when I look at the runtime for loading a view, it looks negligible. I see lots of advantages to loading views and the only rebuttal my coworker could make was browser caching. What's the right answer here?

E.G. which is superior or are they the same?

<script type="text/javascript" src="/path/to/file.js"></script>

OR

$this->load->view("views/path/to/file");

The view version is a php file not a js file. Thanks!!




Theme © iAndrew 2016 - Forum software by © MyBB