Javascript broken across all sites suddently?


Hey guys,

Weird thing has happened sometime yesterday. Anything that uses Javascript across our sites and sub-domains will not function. For example, on two different instances of Joomla on 2 different sites, our image slider module will not load properly.

Thinking this might be a Joomla-related issue, I looked into it a bit further, but in the process found out that our install of ActiveCollab (a project collaboration system completely different from Joomla) was also reporting to all users an error message that “Javascript is not enabled on your computer” as if that were the case (our users all use different browsers/hardware, and this error popped up at around the same time for all of them).

Also, the Joomla admin backend will not function properly. The drop-down menus that house all admin functions will not properly “drop-down”, meaning we cannot administratively change any things related to our sites.

This is so strange and happened so suddenly. Does anyone have even any clue as to what might be going on here? You’d save us a lot of a trouble, we would reeeally appreciate it.



I assume you haven’t made any changes to anything on the server lately? How about the mod times of your JS files? Have they all suddenly changed? Are the JS files actually being sent (check your logs and the developer tools in your browser).


Hey bobocat,

Yeah, you’d be right. No admin/server changes were made since over a week+ ago. I checked the mod times of my JS files, but again that’s checking on the directories of 3 different sites. It’s so weird something ‘broke’ on all 3 which all have different directories and different JS files. I replaced the Joomla JS files (like those from the Media/administration folders with ones from a fresh install of Joomla – no luck).

I’m pretty new when it comes to some of this. How can I check logs and developer tools in my browser to look for hints as to what might be going wrong? Thanks so much for your reply!


it’s not too weird if they are all on the same server and all running under the same user.

look in /home/USER/logs/SITE/http/(access|error).log


I checked there, and whenever I double-click to enter the directory in Filezilla (the FTP prog. I use), I get a “critical file transfer error”. The file logo for it also resembles a shortcut and not a regular file folder, indicating there’s like…nothing there or something. Any idea? Thanks again.


use ssh


What would happen if you point your browser to one of the JS file directly? Does it show the file at all? I suspect malicious .htaccess files were planted in you directories. php functions such as auto_prepend_file, if not used correctly, can stop your JS files from functioning properly. Look for suspicious files!


Hey perry,

You were right on the money. I used Google Chrome’s Java console to find errors when displaying the page, and every .js file was throwing an error. When I went to the .js files themselves, they were still there, but there was a block of garbage code injected into the end of each .js file I have w/ Dreamhost, in every directory/sub-directory, etc. causing the error.

I removed the code on a few of my sites, and BAM, fixed it. But our main site, which has modules upon modules, has .js files all over the place. To remove this same identical block of code would be a veeery timely process.

Any insight as to how one might do this quickly? Write some quick script or something? I’m pretty newb when it comes to this stuff, so I’m afraid it might have to be manual cleansing of all my .js files if I can’t think of anything. (Which is totally fine too, at least I now know what the culprit is!)


Yes, as i mentioned before, learn a little bash and awk. It should take 5 minutes, tops.