-3

I have a html file in which i am loading multiple js files . I need to declare a variable n append to each of the script tag. how i can do that ? appending variable as parameter

Abhishek Sinha
  • 266
  • 3
  • 13

1 Answers1

0
  1. This can be done from the server side as well as client side. Safest way to do it is from server side. Simply set a variable into session containing the current System date of the server and add it onto the page.
  2. If you wish to do it from client side, you need to look for all the script tags in your code with src attribute and append a variable containing the current date to it. You can call this piece of code for window.onload() or document.ready() as per your will.
Aalok Mishra
  • 176
  • 1
  • 11
  • the thing is i cannot use current date and time because i have to update version number only when i m uploading new js file to server. so my version no was 1.0 then in next upload of js i need to version no 1.1 – Abhishek Sinha Jul 27 '15 at 13:36