I have a html page that doesn't change too much and I want to cache it for one week for ex. In this html I have some JS scripts that does some ajax requests and modifies the html. When the browser loads this page, does the JS scripts run?
10x
I have a html page that doesn't change too much and I want to cache it for one week for ex. In this html I have some JS scripts that does some ajax requests and modifies the html. When the browser loads this page, does the JS scripts run?
10x
Yea, it does.
JavaScript is always executed on page load, cached or not.
Unless you're postponing the JS with a onload
handler, of course, then it's executed after the page's loaded.
Yes, JS code runs each time the page is loaded. As well, you can use onLoad event on body tag or jQuery event $(docuemnt).load(...).