Slettet bruger
08. maj 2003 - 18:27
Der er
16 kommentarer og 3 løsninger
En lille udfordring: Find kildekoden
Prøv lige for sjovs skyld at gå ind på denne side:
http://www.doubleyou.com/dyhome.html Højreklik så et sted på siden og se det, der kommer frem...
Det virker vist som en udfordring? :)
Jeg giver 30 point til den første, der kan komme med hele sidens kildekode (ikke fordi, jeg skal bruge den). Du må også gerne oplyse, hvor lang tid det tog dig.
Sæt i gang! :)
P.S. Den kode, man finder, ved at vælge Vis > Kilde i browserens menu er ikke nok. Det skal være den rigtige kode.
Annonceindlæg fra QNAP
<html><head><title>DoubleYou Works</title><LINK REL="SHORTCUT ICON" href=http://www.doubleyou.com/img/dy.ico> <script language="Javascript"src="sj/dynapi.js"></script><script language="Javascript"> DynAPI.setLibraryPath('sj/lib/');DynAPI.include('dynapi.api.*');DynAPI.include('dynapi.event.*');DynAPI.include('dynapi.gui.dynimage.js');DynAPI.addPackage('doubleyou');DynAPI.addLibrary('doubleyou.ext',['frenado','data2003','source','botonera1','wipe_frenado']);DynAPI.include('doubleyou.ext.*');var DYnav=(document.all)?"IE":"NS";if(navigator.appVersion.indexOf('Mac')!=-1)DYnav="MAC";document.write('<link rel=stylesheet type="text/css" href="css/style'+DYnav+'.css">');</script><script language="Javascript"src="dyworks.js"></script><script language="Javascript"src="sj/boleo.js"></script><script language="JavaScript"> function next(){}</script></head><body bgcolor=#ffffff text=#006600 alink=#000000 scroll=no
Slettet bruger
08. maj 2003 - 18:29
#2
Meget af koden ligger jo i js-filerne...
Slettet bruger
08. maj 2003 - 18:30
#3
bredker>> Det var netop Vis > Kilde.
Hvis man i browseren siger File->Save As og vælger type "Web page, complete" får man det hele
Det tog mindre end 30 sekunder
Her er den fil der hedder sj/dynapi.js... Gider ikke til at hente de sidste også, selvom det nu er ret simpelt. Her kommer en ordentlig gang kode! /* DynAPI Distribution DynAPI base Object. Empty shell defining common properties and methods The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ DynObject = function() { this.setID("DynObject"+(DynObject.Count++)); this.isChild = false; this.created = false; this.parent = null; this.children = []; }; DynObject.prototype.getClass = function() { return this.constructor }; DynObject.prototype.setID = function(id) { this.id = id; DynObject.all[this.id] = this; }; DynObject.prototype.addChild = function(c) { if(c.isChild) c.parent.removeChild(c); c.isChild = true; c.parent = this; if(this.created) c.create() this.children[this.children.length] = c; return c; }; DynObject.prototype.removeChild = function(c) { var l = this.children.length; for(var i=0;i<l && this.children[i]!=c;i++); if(i!=l) { c.invokeEvent("beforeremove"); c.specificRemove(); c.created=false; c.invokeEvent("remove"); c.isChild = false; c.parent = null; this.children[i] = this.children[l-1]; this.children[l-1] = null; this.children.length--; } }; DynObject.prototype.deleteFromParent = function () { if(this.parent) this.parent.deleteChild(this); }; DynObject.prototype.removeFromParent = function () { if(this.parent) this.parent.removeChild(this); }; DynObject.prototype.create = function() { this.flagPrecreate(); this.specificCreate(); this.created = true; var l = this.children.length; for(var i=0;i<l;i++) this.children[i].create() this.invokeEvent("create"); }; DynObject.prototype.flagPrecreate = function() { var l=this.children.length; for (var i=0; i<l; i++) this.children[i].flagPrecreate(); this.invokeEvent('precreate'); }; DynObject.prototype.del = function() { this.deleteAllChildren(); this.invokeEvent("beforeremove"); this.specificRemove(); this.created = false; this.invokeEvent("remove"); this.invokeEvent("delete"); }; DynObject.prototype.deleteChild = function(c) { var l = this.children.length; for(var i=0;i<l && this.children[i]!=c;i++); if(i!=l) { this.children[i] = this.children[l-1]; this.children[l-1] = null; this.children.length--; c.del() delete c; } }; DynObject.prototype.deleteAllChildren = function() { var l = this.children.length; for(var i=0;i<l;i++) { this.children[i].del(); delete this.children[i]; } this.children = []; }; DynObject.prototype.toString = function() { return "DynObject.all['"+this.id+"']" }; DynObject.prototype.getAll = function() { var ret = []; var temp; var l = this.children.length; for(var i=0;i<l;i++) { ret[this.children[i].id] = this.children[i]; temp = this.children[i].getAll(); for(var j in temp) ret[j] = temp[j]; } return ret }; DynObject.prototype.isParentOf = function(obj,equality) { if(!obj) return false return (equality && this==obj) || this.getAll()[obj.id]==obj } DynObject.prototype.isChildOf = function(obj,equality) { if(!obj) return false return (equality && this==obj) || obj.getAll()[this.id]==this } DynObject.prototype.specificCreate = function() {}; DynObject.prototype.specificRemove = function() {}; DynObject.prototype.invokeEvent = function() {}; DynObject.Count = 0; DynObject.all = []; Methods = { removeFromArray : function(array, index, id) { var which=(typeof(index)=="object")?index:array[index]; if (id) delete array[which.id]; else for (var i=0; i<array.length; i++) if (array[i] == which) { if(array.splice) array.splice(i,1); else { for(var x=i; x<array.length-1; x++) array[x]=array[x+1]; array.length -= 1; } break; } return array; }, getContainerLayerOf : function(element) { if(!element) return null if(is.def&&!is.ie) while (!element.lyrobj && element.parentNode && element.parentNode!=element) element=element.parentNode; else if(is.ie) while (!element.lyrobj && element.parentElement && element.parentElement!=element) element=element.parentElement; return element.lyrobj } }; DynAPIObject = function() { this.DynObject = DynObject; this.DynObject(); this.loaded = false; this.hookLoad = null; this.hookUnload = null; this.librarypath = ''; this.packages = []; this.errorHandling = true; this.returnErrors = true; this.onLoadCodes = []; this.onUnLoadCodes = []; this.onResizeCodes = []; } DynAPIObject.prototype = new DynObject(); DynAPIObject.prototype.setLibraryPath = function(path) { if (path.substring(path.length-1)!='/') path+='/'; this.librarypath=path; } DynAPIObject.prototype.addPackage = function(pckg) { if (this.packages[pckg]) return; this.packages[pckg] = { libs: [] }; } DynAPIObject.prototype.addLibrary = function(path,files) { var pckg = path.substring(0,path.indexOf('.')); if (!pckg) { alert("DynAPI Error: Incorrect DynAPI.addLibrary usage"); return; } var name = path.substring(path.indexOf('.')+1); if (!this.packages[pckg]) this.addPackage(pckg); if (this.packages[pckg].libs[name]) { alert("DynAPI Error: Library "+name+" already exists"); return; } this.packages[pckg].libs[name] = files; } DynAPIObject.prototype.include = function(src,pth) { src=src.split('.'); if (src[src.length-1] == 'js') src.length -= 1; var path=pth||this.librarypath||''; if (path.substr(path.length-1) != "/") path += "/"; var pckg=src[0]; var grp=src[1]; var file=src[2]; if (file=='*') { if (this.packages[pckg]) group=this.packages[pckg].libs[grp]; if (group) for (var i in group) document.write('<script language="Javascript1.2" src="'+path+pckg+'/'+grp+'/'+group[i]+'.js"><\/script>'); else alert('include()\n\nThe following package could not be loaded:\n'+src+'\n\nmake sure you specified the correct path.'); } else document.write('<script language="Javascript1.2" src="'+path+src.join('/')+'.js"><\/script>'); } DynAPIObject.prototype.errorHandler = function (msg, url, lno) { if (!this.loaded || !this.errorHandling) return false; if (is.ie) { lno-=1; alert("DynAPI reported an error\n\nError in project: '" + url + "'.\nLine number: " + lno + ".\n\nMessage: " + msg); } else if (is.ns4) { alert("DynAPI reported an error\n\nError in file: '" + url + "'.\nLine number: " + lno + ".\n\nMessage: " + msg); } else return false; return this.returnErrors; } DynAPIObject.prototype.addLoadFunction = function(f) { this.onLoadCodes[this.onLoadCodes.length] = f; } DynAPIObject.prototype.addUnLoadFunction = function(f) { this.onUnLoadCodes[this.onUnLoadCodes.length] = f; } DynAPIObject.prototype.addResizeFunction = function(f) { this.onResizeCodes[this.onResizeCodes.length] = f; } DynAPIObject.prototype.loadHandler = function() { this.created = true; eval(this.onLoadCodes.join(";")); if (this.onLoad) this.onLoad(); this.loaded=true; eval(this.hookLoad); } DynAPIObject.prototype.unloadHandler = function() { if (!is.ns4) this.deleteAllChildren(); eval(this.onUnLoadCodes.join(";")); if (this.onUnload) this.onUnload(); eval(this.hookUnload); } DynAPIObject.prototype.resizeHandler = function() { eval(this.onResizeCodes.join(";")); if (this.onResize) this.onResize(); } DynAPI = new DynAPIObject(); DynAPI.hookLoad=window.onload; DynAPI.hookUnload=window.onunload; onload = function() { DynAPI.loadHandler(); } onunload = function() { DynAPI.unloadHandler(); } onresize = function() { DynAPI.resizeHandler(); } onerror = function(msg, url, lno) { DynAPI.errorHandler(msg, url, lno); } DynAPI.addPackage('dynapi'); DynAPI.addLibrary('dynapi.api' ,["browser","dynlayer","dyndocument"]); DynAPI.addLibrary('dynapi.event',["listeners","mouse","dragevent","keyboard"]); DynAPI.addLibrary('dynapi.ext' ,["inline","layer","dragdrop","functions"]); DynAPI.addLibrary('dynapi.gui' ,["viewport","dynimage","button","buttonimage","label","list","loadpanel","pushpanel","scrollbar","scrollpane","sprite"]); DynAPI.addLibrary('dynapi.util' ,["circleanim","cookies","debug","thread","hoveranim","imganim","pathanim","console"]);
Pokkers... Jepser var hurtigere på tasterne end mig. :)
tja her tog det 2 sek.. hvis man har frontpage, word, eller noteblok kna man benytte den funktion ved siden af printeren... så åberner den fx notesblok og wupti vi har kildekode :)
ups det var også js filerne du ville have med :\ så ved jeg ikke lige helt.. så bare drop mit svar..
Tæller indholdet af .js-filer med i "hele sidens kildekode"...? Det er vel et spørgsmål om definition, men det vil jeg personligt ikke mene.
nstenberg >> Jeg vil nu ellers mene at de tæller med. Ligeledes med et CSS dokument.
Slettet bruger
10. maj 2003 - 09:50
#13
JS-filerne er ikke særligt svære at få fat i. Men lad mig omforme reglerne lidt: Prøv at klikke på den hvide prik på den sorte skive. Bevæg derefter musen hen over "Sites". Dér kommer en masse links, bl.a. "san miguel". Den første, der finder ordene "san miguel", løber med de 30 point!
Jeg har fundet ordene... iøvrigt en fed melodi på San Miguel-sitet
Slettet bruger
10. maj 2003 - 11:48
#16
nstenberg>> Bevis? :)
Slettet bruger
11. maj 2003 - 17:11
#17
nstenberg>> Hvis du ikke vil beskrive, hvordan du fandt det, kan jeg jo ikke give dig point! :)
Slettet bruger
14. maj 2003 - 15:32
#18
Ok, jeg lukker spørgsmålet i morgen. Så I må hellere skynde jer! :)
Slettet bruger
18. maj 2003 - 11:08
#19
Nå, jeg deler pointene mellem svarerne, eftersom jeg ikke fik defineret spørgsmålet ordentligt i spørgsmålsteksten.
Computerworld tilbyder specialiserede kurser i database-management