Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascript È¥µôÊý×éÖÐǰ»òºóÖØ¸´Ïî

ÏÂÃæÁ½¸ö·½·¨ÊµÏÖÁËÊý×éÖÐÈ¥µô Ç°Ãæ »òÕß ºóÃæµÄ ÖØ¸´Ïî
È¥µôÇ°ÃæµÄÖØ¸´Ïî·½·¨ °Ñarray [1, 2, 3, 1, 4, 5]È¥µôÇ°ÃæÖØ¸´Ïî µÃµ½ [2, 3, 1, 4, 5].
function unique(a)
{
var r = new Array();
o:for(var i = 0, n = a.length; i < n; i++) {
for(var x = i + 1 ; x < n; x++)
{
if(a[x]==a[i]) continue o;
}
r[r.length] = a[i];
}
return r;
}
È¥µôºóÃæµÄÖØ¸´Ïî·½·¨ °Ñarray [1, 2, 3, 1, 4, 5]È¥µôºóÃæÖØ¸´Ïî µÃµ½  [1, 2, 3, 4, 5].
function unique(a)
{
var r = new Array();
o:for(var i = 0, n = a.length; i < n; i++)
{
for(var x = 0, y = r.length; x < y; x++)
{
if(r[x]==a[i]) continue o;
}
r[r.length] = a[i];
}
return r;
}


Ïà¹ØÎĵµ£º

Javascript´úÂëʵÏÖͼƬ²£Á§ÌØÐ§

ÎļþÄÚÈÝÈçÏ£º£¨Á½¸öÎļþglossy.jsºÍglossy.html£©
/**********************************  glossy.js  ***********************************/
 /**
* glossy.js 1.31 (19-Jul-2007)
* (c) by Christian Effenberger
* All Rights Reserved
* Source: glossy.netzgesta.de
* Distrib ......

JS(javascript)²Ù×÷Êý¾Ý¿â

//°ÑÊý¾ÝдÈëÊý¾Ý¿â
function
res(){
    //»ñÈ¡ÊäÈëÖµ(mynameºÍmymailÊÇÁ½¸öÎı¾¿òµÄid)
    var
uname = document.getElementById("myname"
).value;
    var
umail = document.getElementById("mymail"
).value;
......

javascriptÖеijÉÔ±º¯Êýµ÷ÓõÄÒ»¸öСÎÊÌâ

Ê×ÏÈ¿´demo´úÂ룺
var student={
name:"leo",
intro:function(){
alert("my name is "+this.name);
}
}
var teacher=function(f){
f();
}
teacher(student.intro); 
ÔÚÉÏÃæµÄdemo£¬¿ÉÒÔ¿´µ½ÏÔʽµÄ¶¨ÒåÁËÒ»¸ö¶ÔÏóstudent£¬ÓÐÒ»¸ö³ÉÔ±º¯ÊýintroºÍÒ»¸ö³ÉÔ±±äÁ¿¡£
ÁíÍⶨÒåÁËÒ»¸öº¯Êýteacher£¬½ÓÊ ......

ÓÃJavaScript·â×°ÏÂFileSystemObject£¬×öÏÂÎļþ²Ù×÷£¡

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor
 */
var File = {
    name:'',
    path:'',
    ext:'',
    cfiles:[],
    attributes:{
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ