• 一些过期的整理前端代码


      var MyText = {
        one : "1",
        two : "2",
        three : "3"
      };
      for(var prop in MyText){
        document.writeln(prop + "<br />");
      }
      //var myName = "javk";
      //alert(myName.strike());
      //var name = new String("momo");
      //alert(name.valueOf());
    
      //var boolFlag = new Boolean("");
      //alert(boolFlag.toString());
    
      //var value1 = -1 * Number.MAX_VALUE*2;
      //alert(value1);
    
      //var num = new Number(36.88888);
      //alert(num.toExponential(2));
      //alert(num.toPrecision(4));
      //alert(num.toFixed(3));
    
      /*var str = new String("hello world");
      document.writeln(str.strike() + "<br />");
      document.writeln(str.big() + "<br />");
      document.writeln(str.small() + "<br />");
      document.writeln(str.bold() + "<br />");
      //document.writeln(str.blink() + "<br />");
      //document.writeln(str.italice() + "<br />");
      document.writeln(str.link('www.baidu.com') + "<br />");
      document.writeln(str.sup() + "<br />");
    
      var str = new String("firstName = li ,lastName =    ming,state = shandong,statement =' test split'");
      var arrayTokens = str.split(',',3);
      for(var token in arrayTokens){
        document.writeln(arrayTokens[token] + "<br />");
    
        var newToken = arrayTokens[token].split('=');
        document.writeln(newToken[1].toUpperCase()+"<br />");
    
    
    
      }*/
    
      /*var date = new Date();
      document.writeln(date.getFullYear());
      document.writeln(date.getDay());
      document.writeln(date.getDate());
    */
      /*var value = -3.14;
      document.writeln(Math.ceil(value) + "<br />");
      document.writeln(Math.floor(value) + "<br />");
      document.writeln(Math.exp(4) + "<br />");
      document.writeln(Math.pow(3,2) + "<br />");
    
    for (var i=0;i<10;i++){
      //document.writeln(Math.random().toPrecision(2) + "<br />")
      document.writeln(Math.ceil(Math.random() * 10) + "<br />");
    }*/
    
    /*
      var newArray = new Array();
      for( var i=0;i<10;i++){
        newArray[i] = i+1;
      }
      var newArray2 = newArray.slice(0,5);
      document.writeln(newArray2 + "<br />");
      document.writeln(newArray + "<br />");
      var newArray3 = newArray.concat(newArray2);
      document.writeln(newArray3 + "<br />")
      newArray3.reverse();
      document.writeln(newArray3 + "<br />")
      var str = newArray3.join("----");
      document.writeln(str);*/
      // newArray.splice(0,2,'11','12');
      // for (var num in newArray){
      //   document.writeln(num + "<br />");
      // }
    
    
     /*
      var str = new String("cats,dogs,birds,horses");
      array = str.split(',',4);
      document.writeln(array[2] + "<br />");
      //array.join("--");
      // for (var anm in array){
      //   document.writeln(array[anm] + "<br />");
      // }
      // document.writeln(array + "<br />");
       var date = new Date();
       document.writeln(date + "<br />");
       var hour = date.getHours();
       hour += 168;
       date.setHours(hour);
       document.writeln(date.toString() + "<br />");
    
       var num = 34.44;
       document.writeln(Math.ceil(num) + "<br />");
       document.writeln(Math.floor(num) + "<br />")
    
    */
    
      // var func = prompt("Enter function body: ");
      // var x = prompt("Enter value of x: ");
      // var y = prompt("Enter value of y: ");
      //
      // var op = new Function("x","y",func);
      // var theAnswer = op(x,y);
      //
      // alert("Function is :  "+func);
      // alert("x is :" + x +"y is "+y);
    //  document.writeln(jiecheng(3)+"<br />");
      // var val = new Function("x","y",func);
      // func(x,y){
      //   return x + y;
      // }
      // document.writeln(val(1,2) +"<br  />");
      //var msg = "hello world....0";
      //console.log("%s",msg);
      //var headerElement = document.getElementById("pageHeader");
      //headerElement.style.textShadow = "#ff0000 2px 2px 2px 3px";
       //alert("hello ");
    }
     function mouseDown(nsEvent){
       var theEvent = nsEvent ? nsEvent : window.event;
       var locStrinng = "X:  "+theEvent.screenX + "Y:   "+theEvent.screenY;
      // document.writeln(locStrinng + "<br />");
       alert(locStrinng);
      console.log(locStrinng);
     }
    
    
     function show_coords(event)
      {
        alert("haha");
        x=event.screenX;
        y=event.screenY;
        document.writeln(x+ "     "+ y)
        alert("X coords: " + x + ", Y coords: " + y)
      }
    
      function isShiftkeyDown(event){
        if(event.keyCode == 'A'){
          alert("ok");
        }else {
          alert("not ok ");
        }
    
      }
    
    
      function setObjects(){
        document.getElementById("people").firstName.focus();
      }
      function bubbleUp(event){
        alert("Bubbling:  "+this);
      }
      function setUp(event){
        document.addEventListener("click",bubbleUp,false);
        //document.getElementById("people").addEventListener("click",bubbleUp,false);
        document.forms[0].addEventListener("click",bubbleUp,false);
      }
      function strReverse(str){
        var length = str.length();
        for(var i=length-1;i>=0;i--){
          document.writeln(str.charAt(i));
        }
      }

    <!-- <input type="button" id = "but" value="按钮" /> -->
    <!-- <form id = "people" action="">
    <p>
    <input type="submit" value="Submit" /><br />
    FirstName : <input type="text" name="firstName" /><br /><br />
    LastName : <input type="text" name="secondName" /><br />
    </p>
    </form> -->

  • 相关阅读:
    JS+CSS自动切换选项卡
    漂亮的透明css菜单 下拉效果
    HTML下的默认样式属性
    测测你是否近视!
    CDATA C#操作XML(无命名空间),添加/删除/编辑节点
    JS 键盘事件
    JS获取Cookie值
    解决windows7下不能以管理员身份安装msi的问题
    引用Interop.SQLDMO.dll后的注意事项。
    c#正则表达式用法大全
  • 原文地址:https://www.cnblogs.com/vector11248/p/7580805.html
Copyright © 2020-2023  润新知