This is a simple web application that allows you to look up French department names by their respective 2- to 3-digit codes. It uses jQuery for frontend interaction and JavaScript to perform the department code lookup.
Click here for an online demo!
-
Clone or download this repository to your local machine.
-
Open the
index.html
file in your web browser. -
Enter a 2- or 3-digit department code in the input field.
-
Click the "Verify" button.
-
The department name corresponding to the code will be displayed below the button, or an error message will appear if the code is invalid.
- Validates the input to ensure it's a 2- to 3-digit code.
- Retrieves department data from a JSON file (
departements.json
). - Displays the department name if a valid code is entered.
index.html
: The main HTML file that contains the input field, button, and result display area.Script1.js
: The JavaScript file that handles user interactions and department code lookup.departements.json
: A JSON file containing the mapping of department codes to department names.
Feel free to contribute to this project by making modifications, adding features, or fixing bugs. You can fork the repository and submit pull requests.
I created this web app for a friend approximately eight months ago to provide a practical tool. However, sometime later, our relationship broke up, but the project remains here as a useful resource.
This project is open-source and available under the MIT License. You can find the full license details by clicking on the link.