Javascript弹出对话框3种方式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>三种弹出对话框的用法实例</title>
<script language=javascript >
function ale()
{
//这个基本没有什么说的,就是弹出一个提醒的对话框
alert("我敢保证,贾鹏你现在用的是演示一:提醒对话框");
}
function firm()
{
//利用对话框返回的值(true 或者 false)
if(confirm("你确信要转去贾鹏的博客?"))
{//如果是true ,那么就把页面转向ttp://hi.baidu.com/jiapeng8624237
location.href="http://hi.baidu.com/jiapeng8624237";
}
else
{
//否则说明下了,吼吼……
alert("你按了取消,那就是返回false");
}
}
function prom()
{
var name=prompt("请输入您的名字","YoungBaby提醒您在这里输入您的名字");//将输入的内容赋给变量 name ,
//这里需要注意的是,prompt有两个参数,前面是提示的话,后面是当对话框出来后,在对话框里的默认值
if(name)//如果返回的有内容
{
&nb
相关文档:
上面所说有关HTML的内容非常少又简单,但对已经了解的人来说就是没用的.
如有问题可到权威网 http://www.html.com/ 上查看
以下开始说说关于XML的一些知识.
XML也是标记语言,可它是自定义的,没有已给定格式.不具体说它,给出例子就可明了.
如
<NAME>TOM</NAME>
<SEX>M</SEX>
以上内容的< ......
看书的时候遇到这样一个问题,程序代码如下
var ob = function(){
var obj = this;
function fn1(){
alert( obj === window );//false
alert( this === window );//ture
}
this.fn2 = function() {
fn1();
}
}
当时很不明白fn1里面第二个alert的结果,为 ......
从这篇起,会由浅到深的分析js OO之写类方式,大概会有5-8篇。后面陆续会分析流行库(框架)的写类方式。为了讨论的单一性,暂不考虑类的继承,(私有,受保护)属性或方法。
EMCA262规范中没有类(class)的概念,js的new只是让他看起来更像c++,java一点。这里说的写类,只是书写js代码风格而已。
1、构造函数方式
/**
* P ......
Dynamic Script Elements 动态脚本元素
The Document Object Model (DOM) allows you to dynamically create almost any part of an HTML document using JavaScript. At its root, the <script> element isn't any different than any other element on a page: references can be retrie ......
第二章 Data Access 数据访问
One of the classic computer science problems is determining where data should be stored for optimal reading and writing. Where data is stored is related to how quickly it can be retrieved during code execution. This problem in JavaScri ......