Prototype 工具函數(shù) 學(xué)習(xí)
$H就是建立Hash對象的便捷方法,關(guān)于Hash對象具體參考【Prototype 學(xué)習(xí)――Hash對象 】 $R就是簡歷ObjectRange對象的便捷方法,關(guān)于ObjectRange對象具體參考【Prototype 學(xué)習(xí)――ObjectRange對象 】 Try.these: Accepts...
|
$H就是建立Hash對象的便捷方法,關(guān)于Hash對象具體參考【Prototype 學(xué)習(xí)――Hash對象 】 $R就是簡歷ObjectRange對象的便捷方法,關(guān)于ObjectRange對象具體參考【Prototype 學(xué)習(xí)――ObjectRange對象 】 Try.these: Accepts...
Format Brush table{ border: solid #ccc 1px; } td{ border: solid #ccc 1px; width: 140px; height: 25px; } .selected{ border: solid red 1px; } a{ text-decoration: none; color: black; font-weight: bol...
1,Content-Type 很多時候無法解析就是Content-Type的問題。 如果本身就是xml文件,請?zhí)^這一步 動態(tài)生成的XML一定要將其設(shè)置為text/xml,否則默認(rèn)就是text/html也就是普通的文本了。 常見語言的Content-Type設(shè)置 復(fù)制代...
復(fù)制代碼 代碼如下:function $$() { return Selector.findChildElements(document, $A(arguments)); } 這個類可以分成三個部分:第一個部分就是根據(jù)不同的瀏覽器,判斷使用什么DOM操作方法。其中操作IE就是用普通的getE...
對于如下表單form1: 復(fù)制代碼 代碼如下:<form id="form1"> <input type="text" name="text1"> <input type="button" id="butt_test" value="tt"> </form>只需要運(yùn)用以下代碼即可實(shí)現(xiàn)對表單form1下所有元素的隱藏復(fù)制...
復(fù)制代碼 代碼如下:$(document).ready(function(){ $("p:odd").css("background-color", "#bbf"); $("p:even").css("background-color","#ffc"); $("p").click(function () { $("p").each(function...
復(fù)制代碼 代碼如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style><!-- .errorInfo{ color:red; padding-left:5px; } --></styl...
解決方法:取得表對象,并取得他下面對應(yīng)的行對象下的某個元素,這里如document.tableId.rows[i].cells[j]即取得表下第i行下的第j個元素,然后document.tableId.rows[i].cells[j].colspan=n即可。 eg: dempTHFirst為要增加行...
復(fù)制代碼 代碼如下:parseInt("Hello",10);//return NAN parseInt("110",10);//return 110 所以簡單的判斷字符串是否為數(shù)字的方法就是利用isNaN(),如果返回true,則該字符串不為數(shù)字,否則為數(shù)字復(fù)制代碼 代碼如下:is...
復(fù)制代碼 代碼如下:<script> function getJsFile(url, callBack){ var XH = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject('Msxml2.XMLHTTP'); XH.open('get',url,true); XH.onreadystatechange...
將GOOGLE MAP API 和 GOOGLE Search API 進(jìn)行整合,我用面向?qū)ο蟮姆绞綄懥艘粋€類,通過傳一個經(jīng)緯度進(jìn)去,自動通過GOOGLE LOCAL SEARCH獲取附近的相關(guān)信息。比如餐廳、景點(diǎn)等,反過來標(biāo)到地圖上,并可在任意容器內(nèi)顯...
層隱藏和顯示 2009-7-7 #content1,#content2{ width:300px; height:200px; border:1px solid black; background:#cccccc; } #menu{ cursor:pointer; } 更多 我是更多里面的內(nèi)容 我不是更多里面的內(nèi)容...
支持任意形式(包括圖片自定義)的美化擴(kuò)展,跨瀏覽器支持 支持鼠標(biāo)按住上、下箭按鈕實(shí)現(xiàn)上下滾動 支持鼠標(biāo)滾輪放于“滾動條區(qū)”滾動,而不僅限放于滾動內(nèi)容區(qū)才滾 支持鼠標(biāo)按住滾動條(未松開)并移出滾動區(qū)域仍然能拖拽滾動 滾...
下面介紹的是一些純javascript實(shí)現(xiàn)的語法高亮插件。
英文原文:http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/
1. SyntaxHighlighter我相信這個插件是我們使用多的,它支持超多的...
復(fù)制代碼 代碼如下:/* Based on Alex Arnell's inheritance implementation. */
var Class = (function() { //臨時存儲parent的prototype function subclass() {};
//創(chuàng)建類的方法 function create() { var pare...
sxmsxm.html
復(fù)制代碼 代碼如下:<script> function sonfun() { alert('ok'); } </script>
main.html 復(fù)制代碼 代碼如下:<iframe id="sxm" src="sxmsxm.html" width='100' height='100'></iframe>
在ma...
Ranges represent an interval of values. The value type just needs to be “compatible,” that is, to implement a succ method letting us step from one value to the next (its successor).
Prototype prov...
復(fù)制代碼 代碼如下:RegExp.prototype.match = RegExp.prototype.test;
RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[/]////])/g, '//$1'); };
就一個escape方法,就是把那幾個特...
Enumerable provides a large set of useful methods for enumerations, that is, objects that act as collections of values. It is a cornerstone of Prototype.
Enumerable is what we like to call a module:...
復(fù)制代碼 代碼如下:Object.extend(Number.prototype, (function() {
//返回十六進(jìn)制顏色之 function toColorPart() { return this.toPaddedString(2, 16); }
//返回連續(xù)的下一個數(shù)值 function succ() { retu...
復(fù)制代碼 代碼如下://String對象的靜態(tài)方法 Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '/b': '//b', '/t': '//t', '/n': '//n', '...
復(fù)制代碼 代碼如下:var Template = Class.create({ //初始化方法 initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; },
//格式化方...
復(fù)制代碼 代碼如下:Array.from = $A;
(function() { //Array原型的引用 var arrayProto = Array.prototype, slice = arrayProto.slice, //JS 1.6里面會有原生的forEach方法 _each = arrayProto.forEach;...
This is a simple facility for periodical execution of a function. This essentially encapsulates the native clearInterval/setInterval mechanism found in native Window objects.
This is especially usef...
第一種:view-source法 view-source是一種協(xié)議,早期基本上每個瀏覽器都支持這個協(xié)議。但是不知道什么原因,從IE6 Beta2以后IE就不再支持此協(xié)議了。這個方法現(xiàn)在只能用在FireFox瀏覽器上使用了! 使用方法:在瀏覽器地...