It happens on most, but not all, of the pages I visit. After closing the error message, another one pops up saying "Error: Syntax Error." Closing this window will bring up the initial error message again, and the process repeats five or six times. Eventually the windows will stop popping up and I will be able to view the website, but as soon as I go to another webpage the error messages start again. I've updated both Firefox and Ubuntu to the most recent versions.
Start Firefox in Safe Mode to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
Do NOT click the Reset button on the Safe mode start window or otherwise make changes.