Using Script src with a variable file name
Hello all. I am almost completely new to web design and use FrontPage to create pages. I am, therefore, also almost completely new to working with java and tend to jazz up web pages by taking advantage of code that people make available on web sites.
I am currently trying to use the Script src tag as follows:
However, I am trying to write it so that I have a variable for the src parameter. This is so that when I change the name of the script file, the src will still point to the correct "new" file. The resaon I need this is that using a new file name would "force" my user's browsers to pick up the new file without having to clear the cache.
Further up in the code I have written this:
var today = new Date()
var myyear = today.getFullYear()*10000
var mymonth = (today.getMonth()+1)*100
var myday = today.getDay()+1
var Mydate = myyear+mymonth+myday
var MyLoader = MyScript" + Mydate + ".js"
which, I beleive, creates a variable called MyLoader with the value:
where yyyymmdd is today's date.
Then simply by renaming my script file to MyScript20090303.js for example, this is the file that should be accessed.
However, when I replace by calling line with
I get an error and the script file does not get run.
Is there a way round this or have I missed something out to tell the script command that MyLoader is a variable?
Many thanks for any help I receive!