随笔分类 - [05] JavaScript/Ajax
用于设计网页/网站。AJAX提高用户体验。
摘要: Phone number (123)456-7890 <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TEST.aspx.vb" Inherits="TEST" %> <!DOCTYPE html PUBLIC &qu...
阅读全文
摘要:.NET在后置代码中输入JS提示语句(背景不会变白) Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", ""); 引:http://niunan.javaeye.com/blog/248256
阅读全文
摘要:注意:Option中的O是要大写的,不然语法报错 1.动态创建select function createSelect(){ var mySelect = document.createElement("select"); mySelect.id = "mySelect"; document.body.appendChild(mySelec...
阅读全文
摘要:The alert, confirm, and prompt boxes The three "commands" involved in creating alert, confirm, and prompt boxes are: window.alert() window.confirm() window.prompt() Lets look at them in detail. Th...
阅读全文
摘要:将String类型解析为Date类型. parseDate('2006-1-1') return new Date(2006,0,1) parseDate(' 2006-1-1 ') return new Date(2006,0,1) parseDate('2006-1-1 15:14:16') return new Date(2006,0,1,15,14,16) pa...
阅读全文
摘要:随着用JavaScript编程的深入,你会开始理解那些JavaScript给出的不透明错误信息。一旦你理解了你常犯的一般性错误,你就会很快知道怎样避免它们,这样你写的代码中的错误将越来越少。编程实际上是一种能随着时间不断飞快进步的技术。但是不管变得多么熟练,你仍然要花一些时间调试你的代码。如果你做过家庭作业,或有过JacaScript编程经验,你会知道相当多的时间是花在调试上。这很正常 - ...
阅读全文
摘要:There's a couple of exceptions to look out for when you start developing custom ASP.NET Ajax client controls. They are: Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ctl00_MainContentPlaceHolder__eventsRepeater_ctl01_ke1' can't be ad
阅读全文
摘要:HTML 4.0 Event Attributes New to HTML 4.0 is the ability to let HTML events trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element. Below is a list of attrib...
阅读全文
摘要:Quick reference: .Any character except newline. \.A period (and so on for \*, \(, \\, etc.) ^The start of the string. $The end of the string. \d,\w,\sA digit, word character [A-Za-z0-9_], or whit...
阅读全文
摘要:正则表达式是一个描述字符模式的对象。 Javascrīpt的RegExp对象和String对象定义了使用正则表达式来执行强大的模式匹配和文本检索与替换函数的方法. 在Javascrīpt中,正则表达式是由一个RegExp对象表示的.当然,可以使用一个RegExp()构造函数来创建RegExp对象,也
阅读全文
摘要:Enable the Safari Debug menu option on Windows To enable the Safari Debug menu option, you need to find your Preferences.plist file located in %APPDATA%\Apple Computer\Safari (%APPDATA is typically C...
阅读全文
摘要:================= I have tried like this.. function fnPrint() { document.getElementById('print').style.visibility='hidden'; window.all.print(); document.getElementById('print').style....
阅读全文
摘要:Copy this script into your JavaScript files. It works immediately, and you can query three properties of the BrowserDetect object: Browser name: BrowserDetect.browser Browser version: BrowserDetect.v...
阅读全文
摘要:js函数绑定到asp.net的控件上: 用 控件.Attributes.Add(事件,函数) 。 在 asp.net 中访问 html 控件: 一气之下,把所有控件都换成了 html 的,然后在控件上加上 runat=server 这样在 asp.net 中就可以引用了。用 (FindControl(控件id) as html控件类型).属性,如 (this.FindC...
阅读全文
摘要:In 2005 when Google implemented Google Suggest, Ajax took off. Every web developer was trying to duplicate what Google accomplished. Its now 2008 and there are tons of ways to accomplish Google Suggest. Below is a list of 10 Auto Complete Scripts with various frameworks. The list below is in no part
阅读全文
摘要:网站开发者的一大苦恼,就是有太多的浏览器要应付。幸亏世界上有一些聪明的人,能够研究出一大些方便编辑和调试网页代码的好工具。不过,要从不计其数的小工具里面找出合适的可真不容易。这篇文章列出了几个最好用的web开发工具,并指导你快速地激活、安装、使用他们。 下面是工具列表: Web Developer ToolbarFirefox上开发和调试web站点的不二之选。Web developer too...
阅读全文
摘要:一些前端开发 IE 中的常用调试工具: Microsoft Script Debugger —— Companion.JS need to install this Companion.JS —— Javascript debugger for IE , like Console API feature IE Developer Toolbar —— Like Firebug (DOM/CSS ...
阅读全文
摘要:parseFloat parseFloat("0.55zhang")的结果为0.55parseInt parseInt("123zhang")的结果为123这两个函数都有些容错性的,比如"123abc"会变成123.如果楼主希望更准确一些,其实可以判断一下,然后用eval,像这样不过也可以使用这样的...
阅读全文
摘要:页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网页可见区域宽: document.body.offsetWidth (包括边线的宽)网页可见区域高: document.body.offsetHeight (包括边线的高)网页正文全文宽: document.body.scrollWidth网页正文全文高: do...
阅读全文
摘要:from: http://www.aspxuexi.com/javascript/2007-2-24/2222.htm 在 javascript 中两种方式注册的监听器以及先后注册的监听器调用的顺序在各个浏览器都有所不同,在这里总结一下 IE、firefox 以及 Opera 三种浏览器的调用方式: IE: 通过属性注册的事件最先执行。 attachEvent 方式注册的事件后注册的先...
阅读全文