Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Tuesday, February 14th, 2006

Time Event
12:14p
Javascript Novice...
This is probably way too elementary to admit needing help with, but I haven't spent very much time writing script, so I'd love it (and it would be much appreciated) if someone could please help me.

I need a Javascript for a rotating image, but not just a randomly rotated image... I need it to randomly display an image, but not re-show any images until all the others have shown. I also need the image to change every 3 seconds and link to a different site in a new window. The images would all be 200x65.

If this isn't too complicated, could someone help?

Current Mood: determined
5:55p
detecting if a JavaScript function exists
Hi,

I'm currently developing a web application that will run on various systems and some systems will have a certain JavaScript function and others will not. I need to run an if statement to detect if the function exists, and if so, run it. I don't wish to use the onerror function because that would suppress other errors from users and unfortunately the try/catch block only runs under JavaScript 1.5. I've tried many variations of the following code, but all of them either work only when the function exists or when it does not exist. Do any of you know of a nice backwards-compatible way to do this or of a nice workaround?

function chucktest() {
  alert("I run.");
}

if ( document.chucktest ) {
  chucktest();
} else {
  alert("Function does not exist.");
}


Thanks in advance for any help you can provide!

<< Previous Day 2006/02/14
[Calendar]
Next Day >>
About LiveJournal.com
Image