JavaScript" 对象","属性"集锦
SCRIPT 标记
用于包含JavaScript代码.
属性
LANGUAGE 定义脚本语言
SRC 定义一个
URL用以指定以.JS结尾的文件
window对象
每个HTML文档的顶层对象.
属性
frames[] 子桢数组.每个子桢数组按源文档中定义的顺序存
放.
feames.length 子桢个数.
self 当前窗口.
parent 父窗口(当前窗口是中一个子窗
口).
top 顶层窗口(是所有可见窗口的父窗口).
status 浏览器状态窗口上的消息.
defaultStatus 当
status无效时,出现在浏览器状态窗口上的缺省消息.
name 内部名,为由window.open()方法打开的窗口定义的名字.
方
法
alert("message") 显示含有给定消息的"JavaScript Alert"对话框.
confirm("message") 显
示含有给定消息的"Confirm"对话框(有一个OK按钮和一个Cancel按钮).如果用户单击OK返回true,否则返回false.
prompt("message") 显
示一个"prompt"对话框,要求用户根据显示消息给予相应输入.
open("URL","name") 打开一个新窗口,给予一个指定的
名字.
close() 关闭当前窗口.
frame对象
它是整个浏览器窗口的子窗口,除了
status,defaultStatus,name属性外,它拥有window对象的全部属性.
location对象
含
有当前URL的信息.
属性
href 整个URL字符串.
protocol 含有URL第一部分的字
符串,如http:
host 包含有URL中主机名:端口号部分的字符串.如//www.cenpok.net/server/
hostname 包
含URL中主机名的字符串.如http://www.cenpok.net
port 包含URL中可能存在的端口号字符串.
pathname URL
中"/"以后的部分.如~list/index.htm
hash "#"号(CGI参数)之后的字符串.
search "?"号
(CGI参数)之后的字符串.
document对象
含有当前文档信息的对象.
属性
title 当
前文档标题,如果未定义,则包含"Untitled".
location 文档的全URL.
相关文档:
function QueryString(fieldName){
var urlString = location.search;
if (urlString != null) {
var typeQu = fieldName + "=";
var urlEnd = urlString.indexOf(typeQu);
if (urlEnd != -1) {
var paramsUrl = urlString.substring(urlEnd + typeQu.length);
var isEnd = paramsUrl.indexOf('&' ......
JavaScript方法和技巧大全
1:基础知识
1 创建脚本块
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 隐藏脚本代码
1: <script language=”JavaScript”>
2: ......
添加
<script>
var oDiv = document.createElement("DIV");
oDiv.id = "shop01";
oDiv.style.top = 200;
oDiv.style.left = 200;
oDiv.style.background = '#FFFF00';
oDiv.style.visibility = 'visible';
oDiv.innerHTML="123123"
document.body.appendChild(oDiv ......
JavaScript API
One of the new features we added to the ASP.Net Report Viewer in Visual Studio 2010 is a JavaScript API to allow you to interact with the viewer on client. In reading many of the posts on the report controls forum, we found that many people struggle when implementing a custom ......
1: 遍历并输出Table中值
<table id="tb">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</ ......