易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript开发系列(面向对像)

javascript中的面像对像。
请看代码,下面弹出一个对话筐。
  <script type="text/javascript">
        function win(w, h,,url)
         {
            this.width = 100;
            this.height = 300;
            this.time = 10;
            this.url = url;
            this.openWin = function()
                 {
                  var iTop = (window.screen.availHeight) / 2;
                  var iLeft = (window.screen.availWidth - 10 - w) / 2;
                  window.showModalDialog('open.htm', '', 'dialogHeight=' + this.height + ',dialogWidth=' + this.width + ',help=0;status=1;scroll=1');
              }
         }
         function getWin() {
             var objwin = new win(100, 100,  'open.html');
             objwin.openWin();
          
         }
         window.onload = function() { getWin(); }
       
    </scr


相关文档:

Javascript 中对HTML编码和解码的方法

String.prototype.HTMLEncode = function() {
var temp = document.createElement ("div");
(temp.textContent != null) ? (temp.textContent = this) : (temp.innerText = this);
var output = temp.innerHTML;
temp = null;
return output;
}
String.prototype.HTMLDecode = function() {
var temp = doc ......

javascript 控制左右键盘

<html>  
  <head>  
          <script language="javascript">  
                  function MyClick()   ......

Javascript遍历Html Table(包括内容和 属性值)


1: 遍历并输出Table中值
<table id="tb">
    <tr>
       <td></td>
    </tr>
    <tr>
       <td></td>
    </tr>
</ ......

JavaScript 实现的简繁转换功能

//简繁转换功能
// 将指定元素中的文本转换为简体
function bodytojt(x)
{
var bodys=document.getElementById(x);
bodys.innerHTML=Simplized(bodys.innerHTML);
}
// 将指定元素中的文本转换为繁体
function bodytoft(x)
{
var bodys=document.getElementById(x);
bodys.innerHTML=Traditionalized(bodys.in ......

JavaScript CSS Style属性对照表

JavaScript代码
<mce:script type="text/javascript"><!--
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
// --></mce:script>
<img src="phplamp.gif" onmouseover="imageOver(this)" onmo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号