Include a legal disclaimer on a website comprised of individual pages

The website at was uniquely crafted by hand, without the use of platforms like Wordpress or any PHP-type databases.

Upon its creation over 15 years ago, a legal notice was not initially included on the website. Now, there is a desire to add a link to a legal notice in the footer of each webpage. This legal notice could be located on a separate webpage in the root directory named "legalnotice.html".

The goal is to integrate this legal notice without altering the existing footers of all webpages.

Within the footer of each webpage, there is a mail link structure as shown below:

<quote>
  <!-- Infobas -->
  <div class="infobas">
    <table summary="Bottom footer" width="100%" cellspacing="0" cellpadding="0" border="0">
      <tbody>
        <tr>
          <td class="bas">
            <script type="text/javascript" src="scripts/contactez_nous.txt">
</script><br>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <!-- /Infobas-->
</quote>

In order to point to the "scripts" root directory from a first level sub-directory, the structure would include "../" as follows:

<quote>  
    <!-- Infobas -->
  <div class="infobas">
    <table summary="Bottom footer" width="100%" cellspacing="0" cellpadding="0" border="0">
      <tbody>
        <tr>
          <td class="bas">
            <script type="text/javascript" src="../scripts/contactez_nous.txt">
</script><br>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <!-- /Infobas -->
  </quote>

The script containing email contact information is stored within the script folder located at the root, structured as below (with confidential segments hidden):

<quote>  
  /* "Contactez nous"
    Creates a message with the bee's email address
    and text in the subject field
*/

// Initializing a variable containing the beginning of the HTML code

var contactlink="<a href='mailto:";

/* Adding various elements of the email address
   to the variable
*/
contactlink +="xxx";
contactlink +="@";
contactlink +="yyy.fr";
contactlink +="?subject=%5BAbeille%5D%20Demande%20d%27information'>";

// Displaying the variable along with the term "contact us"
document.write(contactlink+"Contact us @<\/a>");

</quote>

This script, adapted for different levels of sub-directories within the website's structure, exists on every page of the site, providing seamless functionality.


The intention is to create and upload a legalnotice.html page while modifying the script, without requiring alterations to all footer content across the website to accommodate changes in hierarchy for linking to legal notices.

An approach leveraging relative links to the legal notice page would necessitate adjustments to every footer, which isn't ideal. Similarly, using an absolute link poses the risk of becoming obsolete if the website address changes.

Is there a solution that allows for achieving these objectives: (1) avoiding extensive modifications to all footers and (2) ensuring independence from changes in website addresses?

Any suggestions are greatly appreciated. Thank you in advance.

Answer №1

Kudos to Chris G for providing the correct solution! Your insight is truly appreciated, Chris. Initially skeptical of the answer I had received, I decided to investigate further.

Chris, your discovery of confidential information was spot on and much needed. As someone who despises robots, I wanted to ensure this address remained hidden from their prying eyes.

There appears to be a small glitch in your suggestion, which appears to break the link to the mailer. Fortunately, rectifying this bug is a simple task. Being a skeptic at heart, I first replaced /legalnotice.html with

Below is the code snippet:

/* "Contact us"
    Creates a message containing the bee's email address
    and text in the subject field
*/

// Definition of a variable containing the beginning of the HTML code

var contactLink="<a href='mailto:";

/* Adding different elements of the email address
   into the variable
*/
contactLink +="abeille-cyclotourisme";
contactLink +="@";
contactLink +="abeille-cyclotourisme.fr";
contactLink +="?subject=%5BAbeille%5D%20Information%20Request'>";

// Displaying the variable and the text "contact us"
document.write("<a href='https://www.abeille-cyclotourisme.fr/legalnotice.html'>Legal Notice</a> - "+contactLink+"Contact Us @</a>");

While this code functions correctly, it includes the website address, which is not desired. Furthermore, it deviates from what Chris G suggested. In an attempt to align with Chris G's recommendation, I tried:

/* "Contact us"
    Creates a message containing the bee's email address
    and text in the subject field
*/

// Definition of a variable containing the beginning of the HTML code

var contactLink="<a href='mailto:";

/* Adding different elements of the email address
   into the variable
*/
contactLink +="abeille-cyclotourisme";
contactLink +="@";
contactLink +="abeille-cyclotourisme.fr";
contactLink +="?subject=%5BAbeille%5D%20Information%20Request'>";

// Displaying the variable and the text "contact us"
document.write("<a href='/legalnotice.html'>Legal Notice</a> - "+contactLink+"Contact Us @</a>");

This script does not function when run locally. The address /legalnotice.html leads nowhere on a local setup. However, once uploaded to the server (Dreamhost's Debian Linux server), it works seamlessly. Could the difference in servers be the reason it behaves differently locally versus on the server? Thanks in advance.

Once again, thank you Chris G for your invaluable guidance. Your solution has effectively addressed my query, even though I may not fully comprehend why it works.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to dynamically display content based on option selection in AngularJS using ng-show

I am trying to create a functionality where my input field is bound to my select option. When the select option is set to Yes, I want the input field to be visible, and when it's set to No, I want the input field to be hidden. (function(){ var app ...

Ways to resolve the array to string conversion issue in PHP

In my PHP project, I am dealing with a dynamic array and trying to store the array result in a variable. However, I encountered an error: array to string conversion while coding. <?php require_once('ag.php'); class H { var $Voltage; ...

Attempting to configure a webhook eventsub through the Twitch API by utilizing ngrok as the intermediary

After triggering a test event using the Twitch CLI, an error response was received indicating: Post "https://1562-5-182-32-19.ngrok.io/api/twitch/eventsub/": context deadline exceeded (Client.Timeout exceeded while awaiting headers). The notification even ...

Vue: Displayed list displaying checked checkboxes

My attempt at displaying the selected checkboxes is as follows: <pre>{{ JSON.stringify(selectedAttributes, null, 2) }}</pre> <ul class="list-unstyled" v-for="category in categories" ...

Having difficulty rearranging choices within an optgroup

This is a dropdown https://i.sstatic.net/Rk5yL.png <select id="officer-id" placeholder="Choose an officer"> <option selected="selected" >----</option> <optgroup id="pt1" label="To be reviewed"> ...

Firefox compatibility issue with Angular JS for downloading excel files

I've encountered an issue with my AngularJS code for downloading an Excel file. While it works smoothly in Chrome and Internet Explorer, it fails to function in Firefox. The server response isn't presenting any problems. Here's the code snip ...

Is there a way to adjust the time font size according to the dimensions of the time picker?

HTML and CSS .pickthetime { height: calc(var(--vh, 1vh) * 3); width: calc(var(--vw, 1vw) * 25); align-content: center; // center looks better, also tried left to stop it from breaking a new line on Safari on iOS font-weight: 300; } <input cla ...

Utilize a Vue.js filter on the v-model within an input element

Seeking assistance! I successfully created a directive that wraps the Jasny Bootstrap Plugin, specifically focusing on the input mask feature! Additionally, I have developed a custom filter using moment to format date fields! The date format received fro ...

Implementing a click event on an image in an Angular 4 application

I'm facing an issue with adding a click event to an image within an Angular component. I have tried the following code: <img src="../../assets/add.svg" width="18" height="18" (click)="addItem()"> However, this approach does not seem to work as ...

Executing the serverless invoke local command produces no output

Attempting to locally run a node lambda for debugging purposes. Utilizing Serverless and the provided launch configuration in vsCode. { "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launc ...

The information window is malfunctioning on Google Maps

I created buttons that are linked to specific locations on a map and they seem to be functioning, although not in the most efficient way. However, when attempting to add an info window to appear on the marker, it does not work as expected. I am unsure of ...

Take away limitations from JavaScript code

I stumbled upon this code snippet online and I'm attempting to eliminate the Name must be letters only and min 3 and max 20 restriction. The name provided can have less than 3 characters and may include numbers. My JavaScript skills are still in the l ...

Adding an additional border when combining two divs with rounded borders

I attempted to create a design similar to the Instagram "ask me a question" box, but I am encountering an issue where there is some extra border around the title when the two divs merge. What am I doing incorrectly? .info { overflow: hidden; ...

Having trouble retrieving data from the server for the POST request

I am fairly new to using Jquery and Ajax requests. I'm currently working on a website where I have a simple form that collects an email address from users and sends it to the server. However, I'm struggling to figure out how to capture the form d ...

A unique string containing the object element "this.variable" found in a separate file

Snippet of HTML code: <input class="jscolor" id="color-picker"> <div id="rect" class="rect"></div> <script src="jscolor.js"></script> <script src="skrypt.js"></script> Javascript snippet: function up ...

Gain entry to Zurb Foundation for Apps modules within your AngularJS application

Currently, I am developing an AngularJS application utilizing Foundation for Apps. One key element in my layout is a Foundation Apps panel that serves as the top menu. <div zf-panel="" id="topMenu" position="top" class="panel-fixed">...</div> ...

Instant Pay Now Option for Your WordPress Website with PayFast Integration

I have encountered an interesting challenge that I would like some guidance on. My goal is to integrate a PayFast "Pay Now" button into a Wordpress.com blog, specifically within a sidebar text widget. The tricky part is that I need the customer to input th ...

Is there a way to restrict the number of line breaks in a multiline asp:TextBox control?

Is it possible to restrict a multiline asp:TextBox to only display content on 3 lines using either javascript or C#? ...

Struggling to make button switch in my Spring Boot Application (e.g. from "Add to Cart" to "Remove")

My application allows users to add items to their cart, which are then persisted using Spring Data JPA and saved in a MySQL database. I am looking to change the text from "Add to Cart" to "Remove" when the button is clicked, and vice versa. I have attempt ...

Issue encountered while importing dependency in Cypress Cucumber framework

Currently facing an issue with importing certain dependencies in Cucumber. The error message I received is as follows: Running: features\my_feature.feature... (1 of 1) Browserslist: caniuse-lite is outdated. P ...