0

I've modified the js of lightbox and I don't know how to do it for other browsers to load for the new version. On my machine I did Ctrl-F5 but I don't know how to do that for visitors browsers. I was thinking that I can modify the file name of the .js, but this is not a clean&fair approach.

What do you recommend?

2 Answers 2

1

You can use something like this :

randomNumber = Math.floor(Math.random()*999);

<script src="lightbox.js?randomNumber"></script>

It should force the browser to go and download the latest version of the js file at every page refresh.

Sign up to request clarification or add additional context in comments.

2 Comments

most people use a version number, to force the web browser to reload the file. randomNumber = version_number
@IdanHen: very good approach. pls add it as a diferent answer in order to choose it as the solution.
1

try sending from your sevrer of configuration the version_number .

<script src="lightbox.js?version_number"></script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.