For the Love of My Country

Andy Moore's web-development blog: HTML, CSS, JavaScript, Flash (subscribe)
quicklinks: html codes | w3 schools (CSS) | colour codes | archives
blogging at: Star Studded Super Step on politics, abortion, freedom...
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:

Fascinating examples of CSS and JavaScript
Wednesday, February 4, 2009, 7:18 PM  0 Comments
...can be viewed at this website.
There's some amazing examples such as the JavaScript/CSS clock, 3D dots and Galaxies.
They also have a 3D tag cloud which might be fairly simply implemented into a blog... who knows.

Labels: ,

Typewriter text with JavaScript
Sunday, October 26, 2008, 5:37 AM  0 Comments
Right, this is a handy little piece of JS.

It writes text on the screen as if written by a type-writer, character by character.  Of course, you can change the speed, and the formatting of the text.  Wonderful.

Check out what I did with it, it's really simple to get going.

Labels:

JavaScript Image Slideshow
Saturday, October 25, 2008, 9:09 AM  0 Comments
Very simple and effective slideshow.  Click here to see how I've used this great script.

Get the script at www.javascriptkit.com

You might like to modd your script up a bit, take a look at the source of my page to see how I've done it if you like.

Works real well, you just want to name your images 1.jpg, 2.jpg, 3.jpg, etc...

Labels: ,

Single Apostrophes in Javascript
Wednesday, September 3, 2008, 5:26 AM  0 Comments
Heck, I've been plugging away, trying to fix a problem with my JavaScipt.  If you have an apostrophe (') in your script, it can break it.  What you need to do, is change all your...

' into '

' is the HTML number for '

Works a treat! 

(for an example, check out this piece of javascript)

For a list of all HTML codes, click here

Labels: ,

Archives: \April 2007/\June 2007/\September 2007/\August 2008/\September 2008/\October 2008/\December 2008/\February 2009/\March 2009/\May 2009/\July 2009/\August 2009/\September 2009/\October 2009/\November 2009/\December 2009/\January 2010/\February 2010/\March 2010/\August 2010/\September 2010/\December 2010/