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
Ïà¹ØÎĵµ£º
½ñÌìÒ»¸öͬÊÂÐèҪʵÏÖÕâôһ¸öЧ¹û£¬ÓÚÊǾͲâÊÔÁËһϣ¬ÖмäµÄÂß¼ÓÃÁ˺ݳ¤Ê±¼ä£¬²»¹ý×îÖÕ»¹ÊǸã³öÀ´ÁË£¡´úÂëÓеãÓ·Ö×£¬Ã»Ê±¼äÓÅ»¯£¬ÓÐÓõ½ÀàËƹ¦ÄܵÄÅóÓÑ¿ÉÒÔ×Ô¼ºÓÅ»¯Ò»Ï£¡£¨Ðè¼ÓÈë×Ô¼ºµÄjqueryÎļþ£©
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tran ......
ä¯ÀÀÆ÷ÒѾ¿´µ½µÄ¶«Î÷¶¼´æÔÚ»º´æÎļþ¼ÐÀï¡£
½Å±¾×¢ÊÍ: µ¥ÐÐ// ¶àÐÐ/*....*/
Æô¶¯Ê±ºò¼ÓÔØfunction() window.onload= function;
alert Ìáʾ¶Ô»°¿ò alert("ÌáʾÄÚÈÝ");
promptÌáʾÊäÈë¿òprompt("ÌáʾÄÚÈÝ","ĬÈÏÖµ")£»
JavaScriptÖض¨Ïò ÔÚ×°ÔØÒ³Ãæʱ£¬²»ÄÜÔÚ×°ÔØÍêÖ ......
ÖÆ×÷Javascriptµ¯³ö´°¿Ú¼¼ÇɾÅÔò
1¡¢×î»ù±¾µÄµ¯³ö´°¿Ú´úÂë
¡¡¡¡Æäʵ´úÂë·Ç³£¼òµ¥£º
¡¡¡¡< SCRIPT LANGUAGE="javascript">
¡¡¡¡< !--
¡¡¡¡window.open ("page.html")
¡¡¡¡--
>
¡¡¡¡< /SCRIPT>
¡¡¡¡ÒòΪÕâÊÇÒ»¶ÎJavascript´úÂ룬ËùÒÔËüÃÇÓ¦¸Ã·ÅÔÚ< SCRIPT LANGUAGE="javascript">Ö®¼ä¡£ ......
1¡¢×Ö·û´®×ª»»ÎªÊýÖµ
³£¹æ·½·¨£º
JScript code
var a = parseFloat("12");
var b = parseInt("34");
¿ÉÒÔÓÃ
JScript code
var a = +("12");
var b = +("34");
2¡¢¶àάÊý×é
³£¹æ·½·¨£º
JScript code
var A = new Array(2);
A[0] = new Array(2);
A[1] = new Array(2);
A[0][0] = 1;
A[0][1] = 2;
A[1][0] = ......
ºÜ¶àÈ˶¼ÏòÔÚ·þÎñÆ÷
¶Ëµ÷Óÿͻ§¶ËµÄº¯ÊýÀ´²Ù×÷£¬Ò²¾ÍÊÇÔÚaspÖе÷ÓÃjava
script½Å±¾ÖÐÒѾ¶¨ÒåºÃµÄ½Å±¾º¯Êý¡£¾¹ýÑо¿£¬·¢ÏÖÁËһЩÃãÇ¿µÄ·½·¨¡£
1.
ÓÃResponse.Write·½·¨Ð´Èë½Å±¾
±ÈÈçÔÚÄãµ¥»÷°´Å¥ºó£¬ÏȲÙ×÷Êý¾Ý¿â
£¬ÍêÁ˺óÏÔʾÒѾÍê³É£¬¿ÉÒÔÔÚ×îºóÏëµ÷Óõĵط½Ð´ÉÏ
Response.Write("<script type='text/j ......