Thursday, October 12, 2006

How to overcome external JS issues?

For many times now, Blogdrive have chosen to insert an additional text into all blogs and pages "informing" users they are upgrading servers. Sure, we should actually be grateful that they are in fact "informing" us, which under normal circumstances, they don't.

Blogdrive automatically inserts this line of code into the end of all files stored on Blogdrive. Including CSS and JS files.

<p align=center>Upgrading servers.
We'll be back up in a few of minutes.
We are currently storing submitted entries
for later processing.</p>
Now, let's not let the issue of "informing" users of downtime. The issue I'm facing now, has to do with Blogdrive, automatically inserting additional text into my .js files, making them obsolete and not working. I use lotsa external javascript files which are hosted on Blogdrive. But whenever they insert this tags, all my blogs would fail to execute.

So the solution to this problem, without informing Blogdrive of the problem (as they are always too "busy" to pay any attention to a Magnum (plan 4) subscriber such as myself), I simple insert a double slash at the very end of all my js documents.

It does the trick, wonderfully. By inserting a double slash, I basically "comment-out" the auto-inserted code.

Oh, how genius of me to stop a war, not get angry fix the small problem.

No comments: