Have you ever tried to run two javascripts on one page, but found that they conflict, and either only one works, or neither of them work? I had this problem with two
blog sidebar widgets which I made. One widget counts the number of abortions performed worldwide since the page was opened. The other counter counts up the number of women affected by abortion sinice the page was opened. As you would imagine, the two scripts were virtually identical - this caused them to lock up.
I had a shot at renaming various elements within the javascript, but to no avail.
For a while I used a horrible hack - put the javascript for the
abortion affects women counter into an
iframe, and put that script in
another piece of javascript. It worked, but it was ghastly, and frustrating.
Eventually, after skim-reading
this useful page, I found that you basically need to make sure
everything has a different name, and then you'll be sweet.
Compare the two scripts if you like, for reference.
script one
script two
Joy!
Labels: javascript