Hey there StackOverflow community!
I've encountered a problem that I need help with. Whenever I use the following code:
$("#specificDIV").load("new.html")
The HTML content loads into the div, but the CSS and JS don't work properly. The formatting is off, elements like sliders and text overflow outside of their containers, fonts are not displayed correctly, and the slider doesn't function at all.
I tried including the same header from the original HTML file inside new.html to ensure that the CSS and JS are referenced properly, but it didn't solve the issue. I also noticed that .load is deprecated and attempted using:
$("#specificDIV").on("load","new.html")
This resulted in the same broken formatting as before on the first attempt, but now I'm getting an error message when calling it:
load Uncaught TypeError: Cannot create property 'guid' on string "new.html"
This error seems to point back to the deprecated load function. It appears that using .on() isn't the solution either.
How can I resolve the formatting issue with .load() and fix the guid error related to .on()? Your assistance is greatly appreciated!
edit: Here are some screenshots showing what's happening.