Header and Footer Disappear
Answers
-
Hi Dave!
It sounds like the JavaScript file you’re using is causing some unintended side effects on your HTML page. Here are a few suggestions that might help:
- Check for Conflicts: Ensure that the JavaScript file isn’t conflicting with any other scripts or CSS on your page. It’s possible that the script could be altering the DOM in a way that affects your header and footer.
- Inspect the Elements: Use the browser’s developer tools to inspect the header and footer elements when the issue occurs. This can help you identify any changes being made by the JavaScript file.
- Review the JavaScript File: Look through the JavaScript file for any code that could be causing these issues. For example, look for any functions that are manipulating the DOM, altering styles, or hiding elements.
- Try Isolation: Try running the JavaScript file on a simple HTML page with just a header and footer to see if the issue persists. This can help you determine if the issue is with the JavaScript file itself or if it’s a conflict with something else on your original page.
Remember, without seeing the actual JavaScript file or the HTML page, it’s difficult to provide a definitive solution. The suggestions above should help guide your troubleshooting process.
If you can provide more details or share the code, I might be able to provide more specific advice.
-
Hi Miguel, thanks for your response. Here are the files I'm using and a screenshot.
-
Based on the HTML file you provided and the image of the issue, it seems like the JavaScript file is interacting with the DOM in a way that’s causing the header to disappear and a white block to appear at the bottom of the page. Here are some potential causes and solutions:
- CSS Styles: The CSS styles defined in the HTML file might conflict with the styles of the header and footer on your Brightspace page. You could try removing or commenting out the CSS in this file to see if the issue persists.
- DOM Manipulation: The JavaScript code in this file manipulates the DOM to display the search results. If there’s an error in this code, it could potentially cause issues with other elements on the page. You could try commenting out sections of the JavaScript code to see if the issue persists.
- Script Loading Order: The order in which scripts are loaded can sometimes cause issues. If there are other scripts running on your Brightspace page, they might be interfering with the script in this file. You could try changing the order in which your scripts are loaded.
- External Resources: The script in this file fetches a CSV file from an external URL. If there’s an issue with this resource (e.g., it’s not available, or there’s an error in the CSV data), it could potentially cause issues with the script.
- Event Handlers: The script adds an event listener to an input field. If there’s an issue with this event handler (e.g., it’s not defined correctly, or it’s conflicting with another event handler), it could potentially cause issues.
Remember, these are just suggestions based on the information available. For a more accurate solution and a more in-depth investigation, you can also open a support ticket. It would be helpful to have more context, such as any error messages displayed in the browser console or a description of the exact behaviour of the issue.
I hope this helps! Let me know if you have any other questions.