Skip to content

Fix: Move main.js to body and remove duplicate chatbot.js script tag#97

Open
Mohit-001-hash wants to merge 1 commit into
AditixAnand:mainfrom
Mohit-001-hash:fix/move-main-js-and-remove-duplicate-chatbot
Open

Fix: Move main.js to body and remove duplicate chatbot.js script tag#97
Mohit-001-hash wants to merge 1 commit into
AditixAnand:mainfrom
Mohit-001-hash:fix/move-main-js-and-remove-duplicate-chatbot

Conversation

@Mohit-001-hash
Copy link
Copy Markdown

Description

Fixed two bugs in index.html related to script loading:

  1. main.js was in without defer/async — This caused
    render blocking where the browser stopped parsing HTML until
    the script finished loading, slowing down page load time.
    Fixed by moving main.js to the bottom of with other
    scripts.

  2. chatbot.js was duplicated — The script was included twice
    which caused double initialization of the chatbot.
    Fixed by removing the duplicate script tag.

Type of Change

  • Bug fix
  • Performance improvement

Changes Made

File Change
index.html Moved main.js from head to bottom of body
index.html Removed duplicate chatbot.js script tag

How to Test

  1. Open index.html in browser
  2. Open browser dev tools → Network tab
  3. Verify main.js loads after page content
  4. Verify chatbot.js appears only once in network requests

Checklist

  • I have performed a self-review of my code
  • My changes do not break any existing functionality
  • I have commented my code in hard-to-understand areas
  • I have tested changes locally

Additional Notes

All other scripts were already correctly placed at the bottom
of body. This fix makes main.js consistent with the rest.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant