The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Is there a forum for requesting testing Javascript in IE?

Hi, sorry if this is the wrong forum, please redirect me if you need to. I have just implemented my very first piece of javascript using Spry, having had no previous experience with it other than what Dreamweaver puts in on it's own. I am working on a Mac so I'm not able to test if it's working in IE 5.5, 6 or 7 and would like it if someone would be able to check it for me?

I'm particularly excited that I worked out how to get images of the saddles appearing when the Accordions open, so if this isn't working in IE can you please let me know.

When you click on the purple saddle names on the right, the content about the saddle should display and an image of the saddle should appear in full colour (although two of the saddles are black, so they look b&W!).

Not such good news for the JavaScript code though, that's a real mess, though I doubt that Dreamweaver will do anything about that.

Oh, really? It's just what I downloaded from the Spry site - I've actually been trying to use Coda instead of Dreamweaver as it previews better. I know i have to remove all the comments from the CSS (I've left them there to help me out ), but I wouldn't know what the problems are in the JavaScript as I don't know anything about it. I'd like to learn but I don't know that my mind works in that way!

Maybe I'm just being picky, after all I've been coming across serious coding problems in The Definitive Guide for Javascript that aren't in the errata; but there are some issues in the accordion code that I feel should be cleared up, especially for library code.

The very first piece of code for example is as follows

Code Javascript:

var Spry;if(!Spry) Spry ={};if(!Spry.Widget) Spry.Widget={};

It's okay, it does the job, but it could be better. If statements should be enclosed in braces to avoid confusion, but those if statements don't even need to be there. The or operator (||) is very good for assigning a value if one doesn't already exist. Here is how it could be more effectively coded.

Code Javascript:

var Spry = Spry ||{};
Spry.Widget= Spry.Widget||{};

The next line is

Code Javascript:

Spry.Widget.Accordion=function(element, opts)

When you assign an anonymous function, a gap should be left between the function keyword and the parenthesis so that it's not mistakenly seen to be a standard function.

Code Javascript:

Spry.Widget.Accordion=function(element, opts)

This helps to avoid confusion between normal functions and function literals.

But more serious is later on when a new object and a new date are being created. The invoking parenthesis aren't used for both Object and Date.

Code Javascript:

var obj =new Object;

It should be new Object() instead, but even better than that is the following