IE6 vs IE7 JavaScript Listbox Issue

Last post 06-16-2008 9:56 AM by RobBobRob. 2 replies.

Sort Posts:

  • IE6 vs IE7 JavaScript Listbox Issue

    06-11-2008, 3:28 PM
    • Loading...
    • RobBobRob
    • Joined on 12-20-2007, 9:55 PM
    • Posts 22

    I work for a consulting company.  I am doing my development at our main office and was given a laptop with Visual Studio 2005 & IE7 installed on it.  I VPN into the the client's network to put the files on a test web server, then they start testing.  They've been logging a lot of defects that the listbox server controls are not working properly.  One specific issue I've witnessed first hand is that in IE6 when adding items to the listbox in javascript, what are supposed to be whitespaces are showing as % signs.  Everything appears normal in IE7.  Another issue with IE6 is that click events don't seem to register the first time.  Sometimes takes multiple clicks before the onclick event is kicked off. 

    Let's stick to the first issue for now.  Here's my javascript code:

    function AddOption(s) {
     var lstAdd = document.getElementById('ctl00_cphDetail_lstAdd');
     var opt = document.createElement('option');
     opt.text = s;
     opt.value = s;
     if(lstAdd.length == 0) {
         lstAdd.add(opt);
     } else {
         var b = true;
         var len = lstAdd.length;
         for(var i = 0; i <= len - 1; i++) {
             if(lstAdd.options[i].text == opt.text) {
                 b = false;
             }
         }
         if(b) {
             lstAdd.add(opt);
         }
     }
    }

    Also, are there any online resources for coding & troubleshooting javascripting differences for different IE browser versions?

  • Re: IE6 vs IE7 JavaScript Listbox Issue

    06-12-2008, 4:06 PM
    Answer
    • Loading...
    • Mamasu
    • Joined on 11-13-2007, 9:15 PM
    • Columbus OH
    • Posts 63

    The IE team at Microsoft has a free VPC for you to run on your machine with IE6 installed on it. This allows you to test IE6 & IE7 from the same development env.

    VPC Image :http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en

    VPC 2007 (free): http://www.microsoft.com/downloads/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6&DisplayLang=en

    There is also a beta version of IETester out that allows you to test IE5.5- IE8 rendering engines. http://www.my-debugbar.com/wiki/IETester/HomePage

     

    Hopefully this will help you figure out the details of your error.

    Please mark answer if I helped answer your question.
    --
    http://www.codedavecode.blogspot.com
    http://www.linkedin.com/in/dmiyamasu
    http://davemiyamasu.com
    Filed under: , , ,
  • Re: IE6 vs IE7 JavaScript Listbox Issue

    06-16-2008, 9:56 AM
    • Loading...
    • RobBobRob
    • Joined on 12-20-2007, 9:55 PM
    • Posts 22

    This is a very acceptable answer that points me in the right direction.  Thanks!

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter