Prototype 工具函數 學習
$H就是建立Hash對象的便捷方法,關于Hash對象具體參考【Prototype 學習――Hash對象 】 $R就是簡歷ObjectRange對象的便捷方法,關于ObjectRange對象具體參考【Prototype 學習――ObjectRange對象 】 Try.these: Accepts...
|
$H就是建立Hash對象的便捷方法,關于Hash對象具體參考【Prototype 學習――Hash對象 】 $R就是簡歷ObjectRange對象的便捷方法,關于ObjectRange對象具體參考【Prototype 學習――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文件,請跳過這一步 動態生成的XML一定要將其設置為text/xml,否則默認就是text/html也就是普通的文本了。 常見語言的Content-Type設置 復制代...
復制代碼 代碼如下:function $$() { return Selector.findChildElements(document, $A(arguments)); } 這個類可以分成三個部分:第一個部分就是根據不同的瀏覽器,判斷使用什么DOM操作方法。其中操作IE就是用普通的getE...
對于如下表單form1: 復制代碼 代碼如下:<form id="form1"> <input type="text" name="text1"> <input type="button" id="butt_test" value="tt"> </form>只需要運用以下代碼即可實現對表單form1下所有元素的隱藏復制...
復制代碼 代碼如下:$(document).ready(function(){ $("p:odd").css("background-color", "#bbf"); $("p:even").css("background-color","#ffc"); $("p").click(function () { $("p").each(function...
復制代碼 代碼如下: <!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...
解決方法:取得表對象,并取得他下面對應的行對象下的某個元素,這里如document.tableId.rows[i].cells[j]即取得表下第i行下的第j個元素,然后document.tableId.rows[i].cells[j].colspan=n即可。 eg: dempTHFirst為要增加行...
復制代碼 代碼如下:parseInt("Hello",10);//return NAN parseInt("110",10);//return 110 所以簡單的判斷字符串是否為數字的方法就是利用isNaN(),如果返回true,則該字符串不為數字,否則為數字復制代碼 代碼如下:is...
復制代碼 代碼如下:<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 進行整合,我用面向對象的方式寫了一個類,通過傳一個經緯度進去,自動通過GOOGLE LOCAL SEARCH獲取附近的相關信息。比如餐廳、景點等,反過來標到地圖上,并可在任意容器內顯...
層隱藏和顯示 2009-7-7 #content1,#content2{ width:300px; height:200px; border:1px solid black; background:#cccccc; } #menu{ cursor:pointer; } 更多 我是更多里面的內容 我不是更多里面的內容...
支持任意形式(包括圖片自定義)的美化擴展,跨瀏覽器支持 支持鼠標按住上、下箭按鈕實現上下滾動 支持鼠標滾輪放于“滾動條區”滾動,而不僅限放于滾動內容區才滾 支持鼠標按住滾動條(未松開)并移出滾動區域仍然能拖拽滾動 滾...
下面介紹的是一些純javascript實現的語法高亮插件。
英文原文:http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/
1. SyntaxHighlighter我相信這個插件是我們使用多的,它支持超多的...
復制代碼 代碼如下:/* Based on Alex Arnell's inheritance implementation. */
var Class = (function() { //臨時存儲parent的prototype function subclass() {};
//創建類的方法 function create() { var pare...
sxmsxm.html
復制代碼 代碼如下:<script> function sonfun() { alert('ok'); } </script>
main.html 復制代碼 代碼如下:<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...
復制代碼 代碼如下: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:...
復制代碼 代碼如下:Object.extend(Number.prototype, (function() {
//返回十六進制顏色之 function toColorPart() { return this.toPaddedString(2, 16); }
//返回連續的下一個數值 function succ() { retu...
復制代碼 代碼如下://String對象的靜態方法 Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '/b': '//b', '/t': '//t', '/n': '//n', '...
復制代碼 代碼如下:var Template = Class.create({ //初始化方法 initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; },
//格式化方...
復制代碼 代碼如下: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是一種協議,早期基本上每個瀏覽器都支持這個協議。但是不知道什么原因,從IE6 Beta2以后IE就不再支持此協議了。這個方法現在只能用在FireFox瀏覽器上使用了! 使用方法:在瀏覽器地...