Javascript

json(javascript object natation)

什么是json?JSON即JavaScriptObjectNatation,它是一种轻量级的数据交换格式,非常适合于服务器与JavaScript的交互。本文将快速讲解JSON格式,并通过代码示例演示如何分别在客户端和服务器端进行JSON格式数据的处理。尽管有许多宣传关于XML如何拥有跨平台,跨语言的优势,然而,除非应用于WebServices,否则,在普通的Web应用中,开发者经常为XML的解析伤透了脑筋,无论是服

系统 2019-08-29 22:57:56 1859

Javascript

javascript正则表达式基本用法

window.onload=function(){//RegExp的初始化,g是指全局,i是忽略大小写varreg=newRegExp("cat","gi");varexp=/cat/gi;//RegExp的test()方法,返回值是trueorfalsealert(reg.test("cat"));//truealert(exp.test("cats"));//true//String的matc

系统 2019-08-29 22:57:19 1851

Javascript

关于在右下脚弹出窗口javascript代码,并用ASP.

关于在右下脚弹出窗口javascript代码,并用ASP.NET在后台调用(原创)/*构造函数,来初始化相应的属性*/functionPopBubble(caption,content,see){this.content=content;this.caption=caption;this.see=see;this.width=150;this.height=120;this.timeout=150;this.speed=15;this.step=2;thi

系统 2019-08-29 22:14:15 1850

Javascript

Javascript引用指针

Quiz请尝试完成下列完形填空:/*创建一个队列,头为head0,尾为tail0*/functionIntList(head0,tail0){this.head=head0||0;this.tail=tail0||null;}/*返回一个IntList包含数组中的所有数*/IntList.list=function(__args){varsentinel=newIntList(),len=__args.length,p;p=sentinel;for(var

系统 2019-08-12 01:32:09 1850

Javascript

My javascript utils

/**//*Thisfunctionisusetocheckthelengthwhethercurrentlengthisoverflowthedesignatedlength,oncontrolgetfocusoronkeyup*ctrlId:targetcontrol*return:maxlength*/functionlengthCheck(ctrlId,max)...{varoControl=ctrlId;varoX=getAbsoluteLeft

系统 2019-08-29 22:16:23 1841

Javascript

用fason的参数化定时器在javascript中模拟多线程

原帖子发表在http://community.csdn.net/Expert/TopicView.asp?id=4069144author:emu(黄希彤)有csdn的朋友把http://community.csdn.net/Expert/TopicView.asp?id=3191873给翻了出来,这样在javascript中模拟多线程又有了更漂亮的做法了:1emu--用fason的参数化定时器模拟多线程</title</span> <p class="auth-span"> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <span class="muted"><i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 23:22:52</span></span> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1831</span></span> <!-- <span class="muted"><i class="fa fa-comments-o"></i> <a target="_blank" href="https://cuiqingcai.com/7080.html#respond">0评论</a></span> <span class="muted"> <a href="javascript:;" class="action zj-addlike"><i class="fa fa-heart-o"></i><span class="count">16</span>喜欢</a></span>--> </p> </article><article class="excerpt"> <header> <a title="Javascript" class="label label-important zj-del-target" href="/category/66">Javascript<i class="label-arrow"></i></a> <h2> <a class="zj-titles zj-del-target" href="/article/17920" title="javascript 中关于select 的应用和相关操作" target="_blank" onclick="return recordId('cid',66)">javascript 中关于select 的应用和相关操作 </a> </h2> </header> <div class="focus"> <a class="zj-del-target" href="/article/17920" target="_blank"><img style="width: 200px; height: 123px;" class="thumb" src="/Public/static/images/article/6.jpg" alt="" title=""></a> </div> <span class="note" onclick="if (jq.browser.versions.mobile) {window.location.href='/article/17920';}else{window.open('/article/17920');}" style="cursor: pointer;">1检测是否有选中if(objSelect.selectedIndex>-1){//说明选中}else{//说明没有选中}2删除被选中的项objSelect.options[objSelect.selectedIndex]=null;3增加项objSelect.options[objSelect.length]=newOption("你好","hello");4修改所选择中的项objSelect.options[objSelect.selectedIndex</span> <p class="auth-span"> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <span class="muted"><i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 22:59:43</span></span> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1828</span></span> <!-- <span class="muted"><i class="fa fa-comments-o"></i> <a target="_blank" href="https://cuiqingcai.com/7080.html#respond">0评论</a></span> <span class="muted"> <a href="javascript:;" class="action zj-addlike"><i class="fa fa-heart-o"></i><span class="count">16</span>喜欢</a></span>--> </p> </article><article class="excerpt"> <header> <a title="Javascript" class="label label-important zj-del-target" href="/category/66">Javascript<i class="label-arrow"></i></a> <h2> <a class="zj-titles zj-del-target" href="/article/17058" title="十个开源的Javascript框架" target="_blank" onclick="return recordId('cid',66)">十个开源的Javascript框架 </a> </h2> </header> <div class="focus"> <a class="zj-del-target" href="/article/17058" target="_blank"><img style="width: 200px; height: 123px;" class="thumb" src="/Public/static/images/article/16.jpg" alt="" title=""></a> </div> <span class="note" onclick="if (jq.browser.versions.mobile) {window.location.href='/article/17058';}else{window.open('/article/17058');}" style="cursor: pointer;">下面是十个最牛的也是最流行的Javascript框架。它们完全可以担任目前世界上几乎所有一些和Ajax技术相关的和图形界面相关的一切功能。jQueryhttp://jquery.com/如果今天你还不知道jQuery的话,那么作为一个程序员你可能真的是从火星来的了。这恐怕是Ajax中应用最广的框架。包括了许多很不错的UI组件,做出网页的效果也是令人称道的。不过,他最牛的是它的文件大小,只有区区18K,实在是居家旅行,网站开发之首选。下面是一个日历控件,很不</span> <p class="auth-span"> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <span class="muted"><i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 22:49:01</span></span> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1824</span></span> <!-- <span class="muted"><i class="fa fa-comments-o"></i> <a target="_blank" href="https://cuiqingcai.com/7080.html#respond">0评论</a></span> <span class="muted"> <a href="javascript:;" class="action zj-addlike"><i class="fa fa-heart-o"></i><span class="count">16</span>喜欢</a></span>--> </p> </article><article class="excerpt"> <header> <a title="Javascript" class="label label-important zj-del-target" href="/category/66">Javascript<i class="label-arrow"></i></a> <h2> <a class="zj-titles zj-del-target" href="/article/18972" title="Javascript 声明时用“var”跟不用"var"的区别" target="_blank" onclick="return recordId('cid',66)">Javascript 声明时用“var”跟不用"var"的区别 </a> </h2> </header> <div class="focus"> <a class="zj-del-target" href="/article/18972" target="_blank"><img style="width: 200px; height: 123px;" class="thumb" src="/Public/static/images/article/19.jpg" alt="" title=""></a> </div> <span class="note" onclick="if (jq.browser.versions.mobile) {window.location.href='/article/18972';}else{window.open('/article/18972');}" style="cursor: pointer;">Javascript声明变量的时候,虽然用var关键字声明和不用关键字声明,很多时候运行并没有问题,但是这两种方式还是有区别的。可以正常运行的代码并不代表是合适的代码。varnum=1;是在当前域中声明变量.如果在方法中声明,则为局部变量(localvariable);如果是在全局域中声明,则为全局变量。而num=1;事实上是对属性赋值操作。首先,它会尝试在当前作用域链(如在方法中声明,则当前作用域链代表全局作用域和方法局部作用域etc。。。)中解析num</span> <p class="auth-span"> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <span class="muted"><i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 23:13:27</span></span> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1820</span></span> <!-- <span class="muted"><i class="fa fa-comments-o"></i> <a target="_blank" href="https://cuiqingcai.com/7080.html#respond">0评论</a></span> <span class="muted"> <a href="javascript:;" class="action zj-addlike"><i class="fa fa-heart-o"></i><span class="count">16</span>喜欢</a></span>--> </p> </article><article class="excerpt"> <header> <a title="Javascript" class="label label-important zj-del-target" href="/category/66">Javascript<i class="label-arrow"></i></a> <h2> <a class="zj-titles zj-del-target" href="/article/13825" title="JavaScript(JScript)下Singleton(单态)模式的实" target="_blank" onclick="return recordId('cid',66)">JavaScript(JScript)下Singleton(单态)模式的实 </a> </h2> </header> <div class="focus"> <a class="zj-del-target" href="/article/13825" target="_blank"><img style="width: 200px; height: 123px;" class="thumb" src="/Public/static/images/article/7.jpg" alt="" title=""></a> </div> <span class="note" onclick="if (jq.browser.versions.mobile) {window.location.href='/article/13825';}else{window.open('/article/13825');}" style="cursor: pointer;">单态定义:Singleton模式主要作用是保证在Java应用程序中,一个类Class只有一个实例存在。在很多操作中,比如建立目录数据库连接都需要这样的单线程操作。还有,singleton能够被状态化;这样,多个单态类在一起就可以作为一个状态仓库一样向外提供服务,比如,你要论坛中的帖子计数器,每次浏览一次需要计数,单态类能否保持住这个计数,并且能synchronize的安全自动加1,如果你要把这个数字永久保存到数据库,你可以在不修改单态接口的情况下方便的做到</span> <p class="auth-span"> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <span class="muted"><i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 22:08:31</span></span> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1820</span></span> <!-- <span class="muted"><i class="fa fa-comments-o"></i> <a target="_blank" href="https://cuiqingcai.com/7080.html#respond">0评论</a></span> <span class="muted"> <a href="javascript:;" class="action zj-addlike"><i class="fa fa-heart-o"></i><span class="count">16</span>喜欢</a></span>--> </p> </article><article class="excerpt"> <header> <a title="Javascript" class="label label-important zj-del-target" href="/category/66">Javascript<i class="label-arrow"></i></a> <h2> <a class="zj-titles zj-del-target" href="/article/20108" title="javascript做二级联动" target="_blank" onclick="return recordId('cid',66)">javascript做二级联动 </a> </h2> </header> <div class="focus"> <a class="zj-del-target" href="/article/20108" target="_blank"><img style="width: 200px; height: 123px;" class="thumb" src="/Public/static/images/article/3.jpg" alt="" title=""></a> </div> <span class="note" onclick="if (jq.browser.versions.mobile) {window.location.href='/article/20108';}else{window.open('/article/20108');}" style="cursor: pointer;"><%...@pagecontentType="text/html;charset=UTF-8"%><html><head><title>Thisisatest!请选择

系统 2019-08-29 23:28:22 1818

Javascript

Python和JavaScript间代码转换的4个工具

选Python还是JavaScript?虽然不少朋友还在争论二者目前谁更强势、谁又拥有着更为光明的发展前景,但毫无疑问,二者的竞争在Web前端领域已经拥有明确的答案。立足于浏览器平台,如果放弃JavaScript,我们也就没什么可选择的项目了。好吧,也许答案也不是这么绝对。JavaScript已经成为众多其它编程语言争相选择的转换目标(相关实例包括TypeScript、Emscripten、Cor以及Cheerp)。而Python则拥有庞大的追随者群体,另

系统 2019-09-27 17:38:01 1815

Javascript

Event delegation in JavaScript

EventdelegationinJavaScriptPostedatJune30,200909:00ambyNicholasC.ZakasTags:Delegation,DOM,Events,JavaScript,PerformanceLastweek,IspokeatandattendedtheVelocitywebperformanceconferenceinSanJose.ItwasalotoffunandIlearnedalotintheothe

系统 2019-08-12 09:30:22 1814

Javascript

javascript显示当前日期时间和当前为本年第几周

运行效果:javascript文件:functionClock(){vardate=newDate();this.year=date.getFullYear();this.month=date.getMonth()+1;this.date=date.getDate();this.day=newArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六")[date.getDay()];this.hour=date.getH

系统 2019-08-12 09:30:17 1814