SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    canada
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sliderman.js Error - Help

    I am using example two of the Sliderman JS module found here
    Sliderman.js - Examples - JavaScript Image Slider Library - Created by Devtrix

    I have set this up to work in my aspx page and I am having issues in IE7&8, however, when I test in an HTML page it works fine. My IE debuggers is showing a JS error in the aspx page only.

    Can someone please lead in the right direction as to why the same code is rendered differently between these two files? Shouldn't they both work exactly the same?

    Here is my aspx page (JS error in IE)
    AffinityHotels aspx

    Here is the same code (minus the UI) in an HTML page (no JS error in IE)
    Sliderman.js - Examples - Created by Devtrix.net

    Thanks for any feedback. This is a weird one.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by dude9er View Post
    Here is my aspx page (JS error in IE)
    AffinityHotels aspx
    IE9 shows no error. Hang on, check advanced settings are to display notifications about script errors - nope, no problem there.

    Testing in IE8 mode, and there's the problem. Line 170 of the code.

    Code:
    function slideContainer(slidesContainer, display){
        container = newElement('div', {width: display.width, height: display.height, position: 'absolute', top: 0, left: 0, overflow: 'hidden'});
        slidesContainer.appendChild(container);
        return container;
    }
    Testing shows that the newElement() function has no trouble there, and the error occurs on that line, so it has to be the assignment. Why could that be?

    Could it be that the container variable should not reach out beyond the function to make changes to a similar variable at a different scope?

    elsewhere:
    Code:
    var container = slideContainer(parameters.container, display);
    There are a lot of different container variables at different scopes, so it seems that one is trying to clobber the other.
    Let's ensure that the container variable in the slideContainer remains in there:

    Code javascript:
    function slideContainer(slidesContainer, display){
        var container = ...
        ...
    }

    It seems to work after that update.

    This seems to be a genuine bug in the script, which we're now fixed.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    canada
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello paul_wilkins, I can not thank you enough for taking time to look at this problem. Your suggestion worked perfectly. Thanks!!

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by dude9er View Post
    Hello paul_wilkins, I can not thank you enough for taking time to look at this problem. Your suggestion worked perfectly. Thanks!!
    You're welcome. I've notified the author about the bug, and pointed him here to this thread, so hopefully a fix will be in the works at some stage.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by dude9er View Post
    Hello paul_wilkins, I can not thank you enough for taking time to look at this problem. Your suggestion worked perfectly. Thanks!!
    Good news - the plugin has now updated to 1.3.6 with the fix, so future downloads of it will be safe from having this same problem occurring.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    canada
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice. Thanks!


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
  •