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;
}
Ïà¹ØÎĵµ£º
ÎļþÄÚÈÝÈçÏ£º£¨Á½¸öÎļþ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 ......
//°ÑÊý¾ÝдÈëÊý¾Ý¿â
function
res(){
//»ñÈ¡ÊäÈëÖµ(mynameºÍmymailÊÇÁ½¸öÎı¾¿òµÄid)
var
uname = document.getElementById("myname"
).value;
var
umail = document.getElementById("mymail"
).value;
......
Ê×ÏÈ¿´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£¬½ÓÊ ......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor
*/
var File = {
name:'',
path:'',
ext:'',
cfiles:[],
attributes:{
  ......