javascriptдµÄ±í¸ñÅÅÐò
/**
* ±í¸ñÅÅÐò(µ¥¸ö±í¸ñ£¬½µÐò)
* @example
* <code>
* <table is_sort="1">
* <tr>
* <th><a href="javascript:void(0)" mce_href="javascript:void(0)" onclick="table_sort(0, 0)">field1</a></th>
* <th><a href="javascript:void(0)" mce_href="javascript:void(0)" onclick="table_sort(1, 1, 1)">field2</a></th>
* </tr>
*
* <!-- ´Ëtr²»»á²ÎÓëÅÅÐò -->
* <tr>
* <th>...</th>
* <td>...</td>
* </tr>
*
* <!-- ´Ëtr²ÎÓëÅÅÐò is_sortÊôÐÔ sort_valÊôÐÔ -->
* <tr is_sort="1">
* <th sort_val="val1">...</th>
* <th sort_val="val2">...</th>
* </tr>
* ...
* </table>
* </code>
* @param int index ÐèÒªÅÅÐòµÄÁУ¨´Ó0¿ªÊ¼£©
* @param int is_desc ÊÇ·ñ½µÐò
* @param int is_int ÊÇ·ñÐèÒª½«ÅÅÐòֵת»»³ÉintÀàÐÍ
* @return void
*/
function table_sort(index, is_desc, is_int)
{
$('table[is_sort=1]').each(function(){
var i=0, j=0, this_table = this, is_change=false, tr = null, tmp = null, sort_val1=0, sort_val2=0, pattern=/^0+/;
$('tr[is_sort=1]').each(function(){
j = 0;
tr = this;
$('tr[is_sort=1]', this_table).each(function(){
if (j>=i)
{
is_change = false;
//¸ñʽ»¯ÅÅÐòÖµ
sort_val1 = $($('th,td', tr).get(index)).attr('sort_val');
sort_val2 = $($('th,td', this).get(index)).attr('sort_val');
if (is_int)
{
if (sort_val1!='0')
{
sort_val1 = parseInt(sort_val1.replace(pattern, ''));
}
if (sort_val2!='0')
{
sort_val2 = parseInt(sort_val2.replac
Ïà¹ØÎĵµ£º
ÐèÒªÁ˽âµÄHTML֪ʶ
±êÇ© table,tr,th,td
ÓÃÑ»·½øÐÐÖØ¸´²Ù×÷
for(;;){}
javascript×Ö·û´®
ÔÚjavascriptÖУ¬µÚÒ»¸ö×Ö·ûÔÚλÖÃ0ÉÏ¡£cat£¬cÔÚλÖÃ0ÉÏ£¬aÔÚλÖÃ1É ......
»ù±¾ÉÏÈ«²¿¼ÓÁË×¢ÊÍ,Ò»ÐÐÒ»×¢....ºÇºÇ
<!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>
<title>Êý×éÅÅÐò</title>
<mce:style type="text/css"&g ......
javascript¼¯½õ
javascriptÊý×é²Ù×÷»ã×Ü
javascript¶¯Ì¬´´½¨form±íµ¥ ºÍ ½Úµã¿ØÖÆËµÃ÷
¶¯Ì¬¶ÁÈ¡
javascript:function ctys(_ctag){
ctys1=document.createElement(_ctag);
document.body.appendChild(ctys1);
return ctys1
};
newE1=ctys('<TEXTAREA id=www>');
newE1.cols='150';
newE1.rows='30 ......
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
×î»ù´¡µÄºËÐŦÄÜ ÈçÔËËã·û(+-*/µÈ) ¿ØÖÆÁ÷³ÌÓï¾ä(if,for,whileµÈ) µÈµÈÎҾͲ»ËµÁË. ÕâÊÇ×î×î»ù±¾µÄ֪ʶ.
BOM֪ʶ
BOM Browser Object Model ä¯ÀÀÆ÷¶ÔÏóÄ£ÐÍ.
window¶ÔÏóÊÇBOM×îÖØÒªµÄ¶ÔÏó. ÎÒÃÇ¿ÉÒÔ¼òµ¥µÄ°ÑÒ»¸öIE´°¿ÚÀí½âΪһ¸öwindow¶ÔÏó.
window ......