in Education by
In our web application we have lots of JS and CSS files. We need to append a version number to these references every time we deploy the code. This is to make sure that users always get the latest deployed version of the file, and the file will not be served from browser's cache. We plan to do this using our build script. We need to append a parameter to the file reference like . We need to do this for all CSS and JS files. Can someone please suggest the best appraoch to do this? We are planning to do this using regular expression. We will append a random number to the file name. Can you please help me how I can find out all the CSS and JS reference in my HTML page? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Do you need to find all the CSS and javascript references in your HTML files? It would be simpler to use a replaceable token in these files and then run a task in ant to do the replacements. Ant only needs to find the tokens. You could do this with the ReplaceRegExp task (to make the substitution in place), or you could do a Copy or Move with a FilterSet (to make the substitution in copies of the target files). Here is an example using ReplaceRegExp: Here is a sample file before running the build: And here it is after:

Related questions

0 votes
    In our web application we have lots of JS and CSS files. We need to append a version number to these references every ... . We need to append a parameter to the file reference like...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    In case of stochastic update, can static equilibrium be reached? (a) yes (b) no This question was addressed ... Neural Networks of Neural Networks Please answer the above question....
asked Aug 27, 2022 in Education by JackTerrance
0 votes
    I have created a plugin and used a reference to another project (DLL) I have created. The problem ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I have created a plugin and used a reference to another project (DLL) I have created. The problem ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    5. Operating System (a) links a program with the subroutines it references (b) provides a layered, user-friendly ... ) all the above Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    How to install a Custom Jenkins Plugin or a Version of Plugin Not available in Jenkins Update Center?...
asked Jul 17, 2021 in Technology by JackTerrance
0 votes
    I writing a function in my form that require user to upload a file, but doesn't necessary have to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I've recently seen quite a bit of the following pattern in Python: class Foo: pass class Bar: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    When I do this: std::vector hello; Everything works great. However, when I make it a vector of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm relatively new to Swift and Firebase, so I'm not very familiar with the intricacies of how ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    Which object stores references to the request and response objects? (a) sessionContext (b) pageContext (c) HttpSession ... API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which object stores references to the request and response objects? (a) sessionContext (b) pageContext (c) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What are method references?...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    I got some question regarding the shared and static libraries.So let me tell you what i did is, I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am reading a yaml file like so in Python3: def get_file(): file_name = "file.yml" properties_stream ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
...