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的RegExp对象和String对象定义了使用正则表达式来执行强大的模式匹配和文本检索与替换函数的方法.
'***********************
' \\JavaScript//
'
'***********************
在JavaSc ......
JavaScript A Beginner's Guide 3rd Edition
锋利的jQuery
精通Dojo
Using The Dojo JavaScript Library To Build Ajax Applications
Professional JavaScript For Web Developers 2nd Edition
......
今天在补习javascript中。遇到几个相对陌生的运算符,特别在此写下来。
1、三元运算符?:,这是js中唯一一个三元运算符(这和C#中的一样),用法如下
var x=1;
var y=3;
(x>y)?(x-y):(y-x);
2、typeof运算符
typeof 是一个一元运算,放在一个运算数之前,运算数可以是任意类型。 ......
没有按别人的推荐,学什么圣经类的js书,而是随便挑了本《JavaScript in 10 Steps or Less》。
花了3个小时,看了30个task。
讲的非常浅显详细。虽然是E文,但很浅显易懂。
task31:
Calling Functions from Tags
One of the benefits of JavaScript is to be able to tie interactivity to elements of the HTML page. ......