-1

I never touched the Apache 'inner files', but now I need to add a string (that isn't static) to the end of some JavaScript files when serving them via Apache. What should I do / learn to achieve this? Where can I check for a request for a file (myfile.js) and then add a string to the client before he downloads the file?

I'd really like to learn how things work and I don't really have a clue of where to start.

Thanks in advance.

funerr
  • 121
  • 1
  • 1
  • 6

1 Answers1

1

If the string you want to append "isn't static" then simply generate the whole file using the same method as the bit which isn't static.

Or just add another script tag on the page pointing to the URL which generates the non-static bit of javascript.

Alternately fire off a PJAX/SJAX request from the static file to get the dynamic part and inject it at the browser.

symcbean
  • 21,009
  • 1
  • 31
  • 52