tableSort.class.js
コードをコピー コードは次のとおりです:
/* * 表格名不能为空,可为已获取的对象或名字 * 表头名默认为:tag * 通过自行编写接口可实现不同的触发排序方式 * * 作者:Auntion * E-mail:Auntion@Gmail.com * OICQ:82874972 * * 日期:2007年04月22日 - 测试 - 待修正 */ var tableSort= function(element,tagName,upStyle,downStyle){this.table= (typeof(element) == 'string') ? TAGDom.fromId(element) : element;this.td = this.table.getElementsByTagName("td"); this.hName= (tagName.length<1) ? "tag" : tagName;this.rows = this.table.rows;this.byUp = (upStyle == undefined) ? "DescUp" : upStyle ;this.byDown = (downStyle == undefined) ? "DescDown" : downStyle ;var totalTd = [];var totalNr = [];var totalTag= [];this.tempCellIndex; this.tempStatus = {};var setAllTag = function(){ for(var i = 0; i < this.td.length; i++){if(this.td[i].className === this.hName) totalTag.push(this.td[i]);}}.bind(this);var getStatus = function(tagName){this.tempStatus[tagName] = (this.tempStatus[tagName] == true) ? false : true;for(tags in this.tempStatus){if(tags == tagName) return this.tempStatus[tags];else delete this.tempStatus[tags];}}.bind(this);var changeShow = function(cellIn,status){for(var i=0; i<totalTag.length; i++){if(totalTag[i].cellIndex == cellIn){if(status == true) totalTag[i].className = this.byUp;else if(status == false) totalTag[i].className = this.byDown;}else{totalTag[i].className = this.hName;}}}.bind(this);var startSort = function(status){for (var i = totalNr[this.tempCellIndex].length - 1; i > 0; i--){for (var j = 0; j < i; ++j){if ( (status == true) ? totalNr[this.tempCellIndex][j] > totalNr[this.tempCellIndex][j + 1] : totalNr[this.tempCellIndex][j] < totalNr[this.tempCellIndex][j + 1] ){var temp = totalNr[this.tempCellIndex][j + 1];totalNr[this.tempCellIndex][j + 1] = totalNr[this.tempCellIndex][j];totalNr[this.tempCellIndex][j] = temp;for(var n=0; n<totalNr.length; n++){if(n != this.tempCellIndex){var temps = totalNr[n][j+1];totalNr[n][j + 1] = totalNr[n][j];totalNr[n][j] = temps;}}}}};InsertContect();}.bind(this);var InsertContect = function(){ for(var i=0; i<totalTd.length; i++){for(var j=0; j<totalTd[i].length; j++){totalTd[i][j].innerHTML = totalNr[i][j];}};totalTd.length = 0;totalNr.length = 0;};this.init = function(status){for(var i=0; i<(this.td.length/this.rows.length); i++){totalTd[i] = new Array();totalNr[i] = new Array();for(var j=0; j<this.rows.length; j++){if(this.rows[j].cells[i].className !== this.hName){totalTd[i][j-1] = this.rows[j].cells[i];if(IsNumber(this.rows[j].cells[i].innerHTML) == true){totalNr[i][j-1] = parseInt(this.rows[j].cells[i].innerHTML);}else{totalNr[i][j-1] = this.rows[j].cells[i].innerHTML;}}}}startSort(status);} /********************************************************************************************************************************/ /**通过点击标签触发排序事件**/ //public: 通过默认鼠标事键触发 (interface example)(设置用户接口的范例) this.toTagStart = function(){ setAllTag(); //获取标签 for(var i=0; i<totalTag.length; i++){ totalTag[i].sIndex = function(cIndex){ this.tempCellIndex=cIndex }.bind(this); //设置列index totalTag[i].gStatus = function(values){ return getStatus(values) }; //获取与设置状态 totalTag[i].ceShow = function(i,s){ changeShow(i,s) }; //改变显示的东西 totalTag[i].stSort = function(status){ this.init(status) }.bind(this); //初始化 totalTag[i].onselectstart = function(){ return false }; //点击不选中文字 totalTag[i].onclick = function(){ this.sIndex(this.cellIndex); this.status = this.gStatus(this.firstChild.nodeValue); this.ceShow(this.cellIndex,this.status); this.stSort(this.status); } } } }
Language.ext.js
コードをコピー コードは次のとおりです:
/* * By Auntion QQ:82874972 Blog:Auntion@blogbus.com Email:Auntion@Gmail.com 请勿删除此部分注释.谢谢! ver date-2007-02-01 * */ var isIe = /msie/i.test(navigator.userAgent); var TAGDom = { fromId: function(i){ return document.getElementById(i); }, fromName: function(i){ return document.getElementById(i); }, fromClass: function(className,baseId) { this.fatherId = null; if(!baseId){ this.fatherId = document; }else{ this.fatherId = DOM.fromId(baseId); } var basic = fatherId.getElementsByTagName("*") || document.all; var child = null; var classNames = null; var aggregate = []; for (var i = 0; i < basic.length; i++) { child = basic[i]; classNames = child.className.split(" "); for (var j = 0; j < classNames.length; j++) { if (classNames[j] == className) { aggregate.push(child); break; } } } return aggregate; } }; function externalStyle (element, target) { this.setReturn; if (element.currentStyle){ this.setReturn = element.currentStyle[target]; }else if (window.getComputedStyle){ this.setReturn = getComputedStyle (element,"").getPropertyValue(target); } return this.setReturn; } String.prototype.toInt = function(){ return parseInt(this.replace(/[a-zA-Z]+/,'')); } String.prototype.trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); } Function.prototype.bind = function(e) { var source = this; return function() { return source.apply(e,arguments); } } function IsNumber(_str){ var tmp_str = _str.trim(); var pattern = /^(- ¦\+)?\d+(\d+)?$/; return pattern.test(tmp_str); }
使用例_1.htm
コードをコピーします コードは次のとおりです:
<html> <head> <title>Auntion - TableSort 测试交流</title> <style type="text/css"> #bodys{ border-top:1px solid #0099FF; border-left:1px solid #0099FF; } #bodys td { border-bottom:1px solid #0099FF; border-right:1px solid #0099FF; font-size:12px; height:22px; line-height:22px; text-align:left; padding-left:10px; background:#DFEFFF; color:#666666; } #bodys td.tag { background:#95D5FF; color:#333333; font-weight:900; height:28px; line-height:28px; cursor:pointer; } #bodys td.DescUp { background:#FFFFCC url("byUp.gif") no-repeat right 6px; color:#333333; font-weight:900; height:28px; line-height:28px; cursor:pointer; } #bodys td.DescDown { background:#FFFFCC url("byDown.gif") no-repeat right 6px; color:#333333; font-weight:900; height:28px; line-height:28px; cursor:pointer; } </style> <script language="javascript" type="text/javascript" src="Language.ext.js"></script> <script language="javascript" type="text/javascript" src="tableSort.class.js"></script> </head> <body> <table border="0" cellspacing="0" cellpadding="0" id="bodys"> <tr> <td width="45" class="tag">选择</td> <td width="50" class="tag">数字</td> <td width="50" class="tag">字母</td> <td width="80" class="tag">名字</td> <td width="150" class="tag">地址</td> <td width="80" class="tag">时间</td> </tr> <tr> <td><input type="checkbox" checked></td> <td>1</td> <td>a</td> <td>谢诗圆</td> <td>http://www.php.cn/;/td> <td>2007-12-16</td> </tr> <tr> <td><input type="checkbox" checked></td> <td>4</td> <td>c</td> <td>auntion</td> <td>http://www.php.cn/;/td> <td>2006-12-06</td> </tr> <tr> <td><input type="checkbox"></td> <td>3</td> <td>b</td> <td>疯狂的石头</td> <td>http://www.php.cn/;/td> <td>2007-03-12</td> </tr> <tr> <td><input type="checkbox"></td> <td>3.2</td> <td>d</td> <td>谢某人</td> <td>http://www.php.cn/;/td> <td>2000-01-01</td> </tr> <tr> <td><input type="checkbox" checked></td> <td>5</td> <td>f</td> <td>小小强</td> <td>http://www.php.cn/;/td> <td>2008-12-31</td> </tr> <tr> <td><input type="checkbox"></td> <td>7</td> <td>e</td> <td>疯狂的man</td> <td>http://www.php.cn/;/td> <td>2006-11-12</td> </tr> <tr> <td><input type="checkbox"></td> <td>71</td> <td>g</td> <td>小强</td> <td>http://www.php.cn/;/td> <td>2002-08-23</td> </tr> <tr> <td><input type="checkbox" checked></td> <td>8</td> <td>h</td> <td>王庆</td> <td>http://www.php.cn/;/td> <td>1999-08-25</td> </tr> </table> <script language="javascript" type="text/javascript"> var apply = new tableSort("bodys","tag"); apply.toTagStart(); //这里将使用已经定义的一种默认触发方式. </script> </body> </html>
上記は Auntion-TableSort JavaScript クラス file_javascript スキルの内容です。その他の関連コンテンツについては、PHP 中国語 Web サイト ( www.php.cn)!

さまざまなJavaScriptエンジンは、各エンジンの実装原則と最適化戦略が異なるため、JavaScriptコードを解析および実行するときに異なる効果をもたらします。 1。語彙分析:ソースコードを語彙ユニットに変換します。 2。文法分析:抽象的な構文ツリーを生成します。 3。最適化とコンパイル:JITコンパイラを介してマシンコードを生成します。 4。実行:マシンコードを実行します。 V8エンジンはインスタントコンピレーションと非表示クラスを通じて最適化され、Spidermonkeyはタイプ推論システムを使用して、同じコードで異なるパフォーマンスパフォーマンスをもたらします。

現実世界におけるJavaScriptのアプリケーションには、サーバー側のプログラミング、モバイルアプリケーション開発、モノのインターネット制御が含まれます。 2。モバイルアプリケーションの開発は、ReactNativeを通じて実行され、クロスプラットフォームの展開をサポートします。 3.ハードウェアの相互作用に適したJohnny-Fiveライブラリを介したIoTデバイス制御に使用されます。

私はあなたの日常的な技術ツールを使用して機能的なマルチテナントSaaSアプリケーション(EDTECHアプリ)を作成しましたが、あなたは同じことをすることができます。 まず、マルチテナントSaaSアプリケーションとは何ですか? マルチテナントSaaSアプリケーションを使用すると、Singの複数の顧客にサービスを提供できます

この記事では、許可によって保護されたバックエンドとのフロントエンド統合を示し、next.jsを使用して機能的なedtech SaaSアプリケーションを構築します。 FrontEndはユーザーのアクセス許可を取得してUIの可視性を制御し、APIリクエストがロールベースに付着することを保証します

JavaScriptは、現代のWeb開発のコア言語であり、その多様性と柔軟性に広く使用されています。 1)フロントエンド開発:DOM操作と最新のフレームワーク(React、Vue.JS、Angularなど)を通じて、動的なWebページとシングルページアプリケーションを構築します。 2)サーバー側の開発:node.jsは、非ブロッキングI/Oモデルを使用して、高い並行性とリアルタイムアプリケーションを処理します。 3)モバイルおよびデスクトップアプリケーション開発:クロスプラットフォーム開発は、反応および電子を通じて実現され、開発効率を向上させます。

JavaScriptの最新トレンドには、TypeScriptの台頭、最新のフレームワークとライブラリの人気、WebAssemblyの適用が含まれます。将来の見通しは、より強力なタイプシステム、サーバー側のJavaScriptの開発、人工知能と機械学習の拡大、およびIoTおよびEDGEコンピューティングの可能性をカバーしています。

JavaScriptは現代のWeb開発の基礎であり、その主な機能には、イベント駆動型のプログラミング、動的コンテンツ生成、非同期プログラミングが含まれます。 1)イベント駆動型プログラミングにより、Webページはユーザー操作に応じて動的に変更できます。 2)動的コンテンツ生成により、条件に応じてページコンテンツを調整できます。 3)非同期プログラミングにより、ユーザーインターフェイスがブロックされないようにします。 JavaScriptは、Webインタラクション、シングルページアプリケーション、サーバー側の開発で広く使用されており、ユーザーエクスペリエンスとクロスプラットフォーム開発の柔軟性を大幅に改善しています。

Pythonはデータサイエンスや機械学習により適していますが、JavaScriptはフロントエンドとフルスタックの開発により適しています。 1. Pythonは、簡潔な構文とリッチライブラリエコシステムで知られており、データ分析とWeb開発に適しています。 2。JavaScriptは、フロントエンド開発の中核です。 node.jsはサーバー側のプログラミングをサポートしており、フルスタック開発に適しています。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

Dreamweaver Mac版
ビジュアル Web 開発ツール

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール
