SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Perth, Australia
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

    The page is at http://www.batesaustralia.com.au/pony/models.htm

    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!).

    Thanks for your time.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    It seems to work fine in IE7.
    The HTML 4 code validates nicely too.

    Not such good news for the JavaScript code though, that's a real mess, though I doubt that Dreamweaver will do anything about that.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Perth, Australia
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    It seems to work fine in IE7.
    The HTML 4 code validates nicely too.

    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!

    Thanks for letting me know about IE7.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    That's alright.

    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

    Code Javascript:
    var obj = {};
    Last edited by paul_wilkins; Feb 9, 2008 at 03:45.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •