易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

JavaScript document对象

对象属性:
document.title                 //设置文档标题等价于HTML的<title>标签
document.bgColor               //设置页面背景色
document.fgColor               //设置前景色(文本颜色)
document.linkColor             //未点击过的链接颜色
document.alinkColor            //激活链接(焦点在此链接上)的颜色
document.vlinkColor            //已点击过的链接颜色
document.URL                   //设置URL属性从而在同一窗口打开另一网页
document.fileCreatedDate       //文件建立日期,只读属性 ......

JavaScript constructor属性

Definition and Usage
定义与用法The constructor property is a reference to the function that created an object.
constructor属性是所建立对象的函数参考Syntax
语法object.constructor
Example 1
举例
In this example we will show how to use the constructor property:
在这个举例中我们将展示如何使用constructor属性:
<script type="text/javascript">
var test=new Array()
if (test.constructor==Array)
{document.write("This is an Array")}
if (test.constructor==Boolean)
{document.write("This is a Boolean")}
if (test.constructor==Date)
{document.write("This is a Date")}
if (test.constructor==String)
{document.write("This is a String")}
</script>
The output of the code above will be:
输出结果为:
This is an Array
Example 2
举例2
In this example we will show how to use the constructor property:
在这个举例中我们将展示如何使用constructor属性:
<script type="text/javascript">
function employee(name,jobtitle,born)
{
this.name=name
this.jobtitle=jobtitle
this.bo ......

Javascript的常用语句

1.document.write( " "); 输出语句
2.JS中的注释为//
3.传统的HTML文档顺序是:document- >html- >(head,body)
4.一个浏览器窗口中的DOM顺序是:window- >(navigator,screen,history,location,document)
5.得到表单中元素的名称和值:document.getElementById( "表单中元素的ID號 ").name(或value)
6.一个小写转大写的JS: document.getElementById( "output ").value = document.getElementById( "input ").value.toUpperCase();
7.JS中的值类型:String,Number,Boolean,Null,Object,Function
8.JS中的字符型转换成数值型:parseInt(),parseFloat()
9.JS中的数字转换成字符型:( " " 变量)
10.JS中的取字符串长度是:(length)
11.JS中的字符与字符相连接使用號.
12.JS中的比较操作符有:==等于,!=不等于, >, >=, <. <=
13.JS中声明变量使用:var来进行声明
14.JS中的判定语句结构:if(condition){}else{}
15.JS中的循环结构:for([initial expression];[condition];[upadte expression]) {inside loop}
16.循环中止的命令是:break
17.JS中的函数定义:function functionName([parameter],...){statement[s]}
18.当文件中出现多个form表 ......

【技术积累】JavaScript【消息框】

在JavaScript中可以创建三种消息框:警告框、确认框、提示框
警告框经常用于确保用户可以得到某些信息。当警告框出现后,用户需要点击确定按钮才能继续进行操作。
语法:
alert("文本")
确认框用于使用户可以验证或者接受某些信息。当确认框出现后,用户需要点击确定或者取消按钮才能继续进行操作。如果用户点击确认,那么返回值为 true。如果用户点击取消,那么返回值为 false。当需要换行时加上"/n"
语法:
confirm("文本")
提示框经常用于提示用户在进入页面前输入某个值。当提示框出现后,用户需要输入某个值,然后点击确认或取消按钮才能继续操纵。如果用户点击确认,那么返回值为输入的值。如果用户点击取消,那么返回值为 null。
语法:
prompt("文本","默认值")
......

张孝详javascript讲座笔记一

一,脚本程序与javascript
      嵌套在HTML中的语言称为脚本语言,浏览器必须具有脚本引擎对嵌入HTML中的脚本程序进行解释。
     eg:
     <HTML>
<script language="JavaScript">
//VBScript,Jscript,ECMAScript
<!--
alert(new Date());//alert方法只有直到用户单击弹出窗口的“确定”才返回
// -->
</script>
</HTML>
     可以通过script标签的language属性指定所用的脚本语言,VBScript是微软的脚本语言,也是ASP的服务器端的脚本语言。
     <script language="VBScript">
<!--
//VBScript的语句不用;分割,且NetScapt等浏览器不支持VBScript脚本
alert(Date())
//-->
</script>
二,JavaScript的简介
     前身叫做LiveScript,是一种基于对象(object-based)和事件驱动(Event Driven)并具有安全性能的脚本语言,是NetScapte公司的产品。
    1,javaScript与Java
     是两个公司开发的两个不同的产品 ......

Javascript 获取页面上选中的文字

IE可以调用:
 
<script type="text/javascript">
 
// 说明:获取页面上选中的文字
// 整理:http://www.CodeBit.cn
 
function getSelectedText() {
    if (window.getSelection) {
        // This technique is the most likely to be standardized.
        // getSelection() returns a Selection object, which we do not document.
        return window.getSelection().toString();
    }
    else if (document.getSelection) {
        // This is an older, simpler technique that returns a string
        return document.getSelection();
    }
    else if (document.selection) {
        // This is the IE-specific technique.
        // We do no ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [2446] [2447] [2448] [2449] 2450 [2451] [2452] [2453] [2454] [2455]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号