Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update index.js #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iashishkpal wants to merge 1 commit into bobbyiliev:main from iashishkpal:patch-1
Closed

Update index.js #172

iashishkpal wants to merge 1 commit into bobbyiliev:main from iashishkpal:patch-1

Conversation

@iashishkpal
Copy link

@iashishkpal iashishkpal commented Oct 27, 2024

Issue :

  1. The event listener for nav-mobile-btn is repeated twice. This causes redundant code and adds two identical event listeners to the same element.
  2. The code directly tries to access document.getElementById("year").innerHTML = year without checking if the element exists. If there’s no element with the ID year, this will cause an error.

Solution :

  1. The second, repeated block for nav-mobile-btn was removed.
  2. Added a check to ensure document.getElementById("year") exists before setting its innerHTML.

Issue : 
1. The event listener for nav-mobile-btn is repeated twice. This causes redundant code and adds two identical event listeners to the same element.
2. The code directly tries to access document.getElementById("year").innerHTML = year without checking if the element exists. If there’s no element with the ID year, this will cause an error.
Solution :
1. The second, repeated block for nav-mobile-btn was removed.
2. Added a check to ensure document.getElementById("year") exists before setting its innerHTML.
Copy link

what-the-diff bot commented Oct 27, 2024

PR Summary

  • Simplified Mobile Navigation Code
    The PR removed some superfluous comments and unnecessary codes related to the mobile navigation button to create a cleaner, more efficient code.

  • Current Year Dynamic Setting
    A new function was added that automatically sets and updates the current year in the #year element, if it’s available on the web page. This means no manual updates will be necessary every year.

  • Improved Mobile Navigation Toggle
    While refining the mobile navigation code, the toggle functionality has been retained and clarified. This means that mobile users can continue to comfortably navigate through the website with a clearer, simplified code base.

Copy link
Author

please merge my pull request.

marcelozarate reacted with thumbs up emoji

Copy link
Owner

Thank you for the suggestion, but it is not really an issue as it is. I will close the PR for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /