Results 1 to 3 of 3

Thread: Uninitialized "temp" array in Cross Browser Marquee I

  1. #1
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Uninitialized "temp" array in Cross Browser Marquee I

    1) Script Title: Cross Browser Marquee I

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

    3) Describe problem:

    The "temp" variable in the "populate()" function appears to be uninitialized. It is used only once in the following line where the "offsetWidth" element is being selected for "actualwidth" in the event the "all" element of "document" is not null:

    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth;

    Is this a debugging artifact? What work around do you suggest?

    Regards,

    Aza D. Oberman
    January 22, 2014

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No it's not for any debugging, but it is sloppy and outdated. You can make it merely outdated by changing that line to:

    Code:
    actualwidth=document.all? document.all['temp'].offsetWidth : document.getElementById("temp").offsetWidth;
    Or, since IE 4 and less are rarely if ever used any longer, make it up to date by changing it to:

    Code:
    actualwidth = document.getElementById("temp").offsetWidth;
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John. I'd figured that out plus a bunch of other diddles to make nice with some of the handhelds.

    The clearly non-random sample from our SSI logs shows a remarkable number of ancient and mystery browsers. Might just as well have the pages render on as many as possible.

    Regards,

    Aza

Similar Threads

  1. Modification of "Cross browser Marquee script" to dynamic width
    By anycall in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-22-2008, 08:34 AM
  2. Replies: 1
    Last Post: 03-09-2008, 03:40 PM
  3. Need help in "Cross-Browser Rich Text Editor"
    By ranacse05 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-06-2008, 09:44 PM
  4. script "Cross Browser marquee II" work in dreamweaver ?
    By leonidassavvides in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-25-2007, 07:30 AM
  5. Query on "Cross Browser marquee II"
    By joycie in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 08-09-2006, 06:35 AM

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
  •