Small question about javascript. From my understanding, whenever I view a webpage that requires a js file, the file is downloaded to the client computer and accessed from there. Are any checks performed while "using" the information in this js file? What's stopping me from changing this file on my end (client) and then accessing the webpage? How is the integrity of this js verified?

the 'integrity' is only verified when trying to talk back to a webpage from js.

there's no way to stop someone changing the implementation of a cached javascript file associated with your webpage, and you should plan and design with that in mind.

you can prepend 'Cache-Control:NO-CACHE' to the HTTP headers that get sent out with .js files to prevent them ever being cached (how to do that would depend on your server software), but even that wont stop people forcing them to cache if they have a desire to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.