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 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 ......
内容从网上收集,收集目的仅供研究、学习。涉及版权或不希望收录您的文章请您及时与我联系。
方法一:
个人认为最好的方法.采用的是正则表达式,这是最核心的原理.
其次.这个方法使用了JavaScript 的prototype 属性
其实你不使用这个属性一样可以用函数实现.但这样做后用起来比较方便.
下面就来看看这个属性是怎么来用的 ......
下面都是我收集的一些比较常用的正则表达式,因为平常可能在表单验证的时候,用到的比较多。特发出来,让各位朋友共同使用。呵呵。
匹配中文字符的正则表达式: [u4e00-u9fa5]
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了
匹配双字节字符(包括汉字在内):[^x00-xff]
评注:可以用来计算字符串的长度(一个 ......
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
......