摘要:目前的的页面布局都是基于XHTML,通过DIV+CSS布局,实现DHTML的样式。所以这个JavaScript动态的为元素添加事件因此而普遍了。下面我说说怎样通过javascript为元素动态的添加事件.Javascript为元素动态的添加事件包括两种情况:不带参数的事件和带参数的事件。一、不带参数的事件:两种方式:直接给对象添加事件,节点添加事件例如给一个id为tab1的添加onclick事件第一种情况:var t = document.getElementById("NewTitle");t.onclick = function showmsg(){ alert(
阅读全文
摘要:给你参考一下, JS兼容就可以实现了, 最重要的内容我已经用红色标出:IE 与 FireFox 的 showModalDialog 在网页程序中,有时我们会希望使用者按下按钮后开启一个保持在原窗口前方的子窗口,而在IE中,我们可以使用showModalDialog来达成,语法如下 : vReturnValue = window.showModalDialog(sURL [, vArguments]...
阅读全文
摘要:Date 对象用于处理日期和时间。创建 Date 对象的语法:var myDate=new Date()Date 对象会自动把当前日期和时间保存为其初始值。参数形式有以下5种: new Date("month dd,yyyy hh:mm:ss"); newDate("month dd,yyyy"); newDate(yyyy,mth,dd,hh,mm,ss); new Date(yyyy,mth...
阅读全文
摘要:http://www.tzwhx.com/newOperate/html/1/11/114/19468.html
阅读全文
摘要:http://blog.lixiphp.com/online-seo-html-css-js/http://www.cssdrive.com/index.php/main/csscompressor/ css压缩http://javascriptcompressor.com/ js压缩http://www.radys.cn/article.asp?id=77 js插件http://coffeescripter.com/code/ad-gallery/ 相册插件http://topic.csdn.net/u/20100705/09/d270754c-6f5d-4864-84b2-5d4013ca
阅读全文
摘要:js代码(function($) { $.fn.extend({ ajaxPager: function(options) { var defaults = { startPage: 1, PagesCount: 10, ChangeSiteEvent: null, ShowFirstLast: false, ShowGoBack: true }; var options = $.extend(d...
阅读全文
摘要:function showimg(ele) { ele.src = "http://cm.aqioo.com/Styles/Expert/images/default120.gif";}<img cg width="100" height="100" alt='<%= model.model.Topic %>' src='<%=imgpath+"/"+model.model...
阅读全文
摘要:$(function() {$.ajax({url: "http://****.***.com/***.html?callback=?",dataType: "jsonp",jsonp: 'callback'});}); public ContentResult ***() { int state = 0; if (HttpContext.User.Identity.IsAuthenticate...
阅读全文
摘要:注意:remote你需要的参数名,如这里的email不能写到data哪里。这是js插件的bug<script type="text/javascript"> $(function() { $.validator.addMethod("checkName", function(value, element) { value = $.trim(value); $(element).val(...
阅读全文
摘要:1、加入 <param name="wmode" value="transparent" />2、加入 <embed src="YourFlash.swf" wmode="transparent" ... ></embed>参考http://www.artery.cn/news/WEBbiaozhunhua/2009-06-14/197.html源代码
阅读全文
摘要:<html xmlns="http://www.w3.org/1999/xhtml"><body xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><img width='77' height='5' src='chrome://livemargin...
阅读全文
摘要:<html xmlns="http://www.w3.org/1999/xhtml"><body xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><img width='77' height='5' src='chrome://livemargin...
阅读全文
摘要:<html xmlns="http://www.w3.org/1999/xhtml"><body xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><img width='77' height='5' src='chrome://livemargin...
阅读全文
摘要:function addEvent(obj, evType, fn){if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true;} else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r;} else { return false;}}function removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventL
阅读全文
摘要:javaScript获取窗口的高度和宽度网页可见区域宽:"+ document.body.clientWidth; 网页可见区域高:"+ document.body.clientHeight; 网页可见区域宽:"+ document.body.offsetWidth +" (包括边线和滚动条的宽)"; 网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽...
阅读全文
摘要:<!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 runat="server"&...
阅读全文
摘要:js刷新页面 方法大全本文转载于:http://www.jb51.net/article/14397.htm一、先来看一个简单的例子: 下面以三个页面分别命名为frame.html、top.html、bottom.html为例来具体说明如何做。 frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下: 1<!DOCTYPEHTMLPUBLIC"-/...
阅读全文
摘要:各浏览器中cookie限制(转自IamUED) * 注①:包括key及value,以及分号、等号 * 注②:总字节数也受HTTP Server的设置影响; Apache用这2个参数调整: LimitRequestFieldSize 限制客户端发送的请求头的字节数 【默认 8190】 LimitRequestLine 限制接受客户端发送的HTTP请求行的字节数【默认 8190】 当cookie超出S...
阅读全文
摘要:<!--# 星级评分# star:value = 分数--><div class="shop-rating"><span class="title">物流公司的服务:</span><ul class="rating-level" id="stars2"><li><a class="one-star" star:value...
阅读全文
摘要:var img = "", controltype;new selectArea("spanSelectArea", "btnSelectArea", "divAreaContent", "ulProvince", "ulCity", "cityArea", "ulSelectResult", 5, "divHidden", "closespan2", true);new dragLayerObj...
阅读全文