Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Script within script
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Script within script
Divers
Thread ID:
01659975
Message ID:
01659975
Vues:
44
Hi,

I created a footer.html that is supposed to be shown on all pages of the site. The pages are all static, html.
The footer.html is pretty simple. It has a P element with Copywrite and the year. But I want the year to be scripted, so that I don't have to change it every year. So the line in the footer.html that has the year is as follows:
<script>document.write(new Date().getFullYear());</script>
And the way I show the Footer in the page is as follows:

in the Head section:
 <script>
        $(function () {
            $("#footer").load("footer.html");
        });
    </script>
And in the Page.html:
<div id="footer"></div>
Everything works if I don't have the Script element in the Footer.html.

How could I show the current year in the Footer.html without the script? or how do I use Script within the footer?

TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform