Tags: IE,javascript

Sort by: Date / Title /

  1. 10 years ago by spirit
    if toFixed is not defined
    1. if (!num.toFixed)
    2. {
    3.  
    4.  Number.prototype.toFixed = function(precision) {
    5.      var power = Math.pow(10, precision || 0);
    6.      return String(Math.round(this * power)/power);
    7.  }
    8.  
    9. }
    10.  
    11. // OR
    12.  
    13.   Number.prototype.toFixed = function(precision)
    14.   {
    15.      var num = (Math.round(this*Math.pow(10,precision))).toString();
    16.      return num.substring(0,num.length-precision) + "." +
    17.             num.substring(num.length-precision, num.length);
    18.   }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1403"></script>
  2. 11 years ago by spirit
    1. Remove the events from the options, use an event directly on the select instead.
    2.  
    3. function myfunc(value) {
    4.   alert(value);
    5. }
    6. ...
    7. <select onchange="myfunc(this.options[this.selectedIndex].value)">
    8.   <option value="1">Item1</option>
    9.   <option  value="2">Item2</option>
    10. </select>
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/761"></script>

First / Previous / Next / Last / Page 1 of 1 (2 posteets)