#1
  1. No Profile Picture
    hum...
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Brazil
    Posts
    24
    Rep Power
    0

    Unhappy javascript don't work in IE 5


    function abriurl(f){
    if (f.options[f.selectedIndex].value != "")
    {
    var curl = f.options[f.selectedIndex].value;
    var url = "http://www." + curl + ".com";
    location.href(url);
    }
    }



    <select name="dom" size="3" class="selq" onchange="abriurl(this);">
    <option value="">------ Domains -----</option>
    <option value="domain1"> Domais 1 </option>
    <option value="domain2"> Domais 2 </option>
    <option value="domain3"> Domais 3 </option>
    </select>


    This works in IE 6, but don't work in IE 5 and Netscape 7. Why?
    Thanks in advance.

    ____________
    Ricardo
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    window.location.href is a property, not a function:

    location.href = url;

    ..or, simply

    location = url;

    http://www.forerunners.org/WebLibrar...pt/ch13_02.htm
  4. #3
  5. No Profile Picture
    hum...
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Brazil
    Posts
    24
    Rep Power
    0
    It's work!
    Thanks a lot!

    Regards,
    Ricardo

IMN logo majestic logo threadwatch logo seochat tools logo